Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Loading / Pasting bitmaps

Author
Message
Evangelion
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: United Kingdom
Posted: 2nd Apr 2003 18:53
The following code is the start of a FPS, my problem is that i load the images at the start and assign the numbers to them; i then use the paste command to load them. When i run the program i get the error message that it cannot load the image; that it doesn't exist. However when you compile it, it finds no errors. The files are in the right folders and when the error message is displayed the image is displayed on the screen so its loading it, it just doesn't like to.
(Error on line 20)

`setting visaul properties
set display mode 640,480,32
hide mouse
sync on
sync rate 30
rem ****************************************************************************************************************
rem *********************************************MEDIA**************************************************************
rem ****************************************************************************************************************
load bitmap "graphics\main001.bmp",1
load bitmap "graphics\mainlogo.bmp",2
load bitmap "graphics\crow.bmp",3
load bitmap "graphics\story1.bmp",4
load bitmap "levels\dirt.bmp",5
`load image "graphics\mainfade.bmp",6
rem ****************************************************************************************************************
rem *********************************************Main game loop*****************************************************
rem *******************************************(image media only)***************************************************
rem menu
paste image 1,0,0
wait 3000
set cursor 280,400
print "press any key to continue"
suspend for key
`fade out screen
for f=0 to 255 step 8
r=255-f
g=255-f
b=255-f
set gamma r,g,b
next f
cls
rem ****************************************************************************************************************
rem *********************************************company logo*******************************************************
rem ****************************************************************************************************************
`load company logo BS
paste image 2,0,0
`fade back in menu screen
for f=0 to 255 step 8
r=f
g=f
b=f
set gamma r,g,b
next f
`start of menu commands
rem ****************************************************************************************************************
rem *********************************************Menu loop**********************************************************
rem ****************************************************************************************************************
main:
paste image 3,0,0
show mouse
do
`Menu Options
`START
if btn_click(25,64,166,95)
gosub start
endif
`PRACTICE
if btn_click(218,87,321,117)
gosub practice
endif
`OPTIONS
if btn_click(371,104,482,141)
gosub options
endif
`EXIT
if btn_click(230,312,406,352)
gosub exit
endif
`Button Clcik Function
function btn_click(x1,y1,x2,y2)
clicked=0
if mousex()>x1 and mousex()y1 and mousey()0 and XTest#0 and ZTest#
Not much time has passed but already she likes Concrete better then Grass.
Evangelion
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: United Kingdom
Posted: 2nd Apr 2003 18:54
Sorry that didn't post properly.

The following code is the start of a FPS, my problem is that i load the images at the start and assign the numbers to them; i then use the paste command to load them. When i run the program i get the error message that it cannot load the image; that it doesn't exist. However when you compile it, it finds no errors. The files are in the right folders and when the error message is displayed the image is displayed on the screen so its loading it, it just doesn't like to.
(Error on line 20)



Not much time has passed but already she likes Concrete better then Grass.
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 2nd Apr 2003 18:59
you have to get image from a bitmap, or if you want the whole bitmap as your image, use load image instead of load bitmap
Evangelion
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: United Kingdom
Posted: 2nd Apr 2003 19:35
i just tried that but i still get an error message saying cannot load bitmap. When it goes back to the editor it highlights the line under the paste command: 'wait 3000' Do you think the wait command could have something to do with it?

Not much time has passed but already she likes Concrete better then Grass.
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 2nd Apr 2003 19:38
The wait command is fine. Use "load image", not "load bitmap" or you can't paste them like you're doing.

More importantly - have you created a proper Project file for this? Or did you just start DBPro and start typing? If you did then you're working out the Temp directory which is probably why it fails.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Evangelion
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: United Kingdom
Posted: 2nd Apr 2003 19:46
OK i have changed form load bitmap to load image but i still get the same runtime error msg, saying that it can't load the bitmap. Even though when the error msg is displayed the image is clearly display in the background.



Not much time has passed but already she likes Concrete better then Grass.
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 3rd Apr 2003 03:38
Your code (well, what was posted here anyway) works fine. Suggest you check out your image files, check the sizes, check they exist, check the path, check any more of the code? etc etc. Hell, take it back to basics:

load image "blah.bmp",1
paste image 1,0,0

etc on each image until you find a problem.. put bits of code back in bit by bit.. etc. This can't be hard to fix, it will take some leg work though.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming

Login to post a reply

Server time is: 2024-11-24 08:35:05
Your offset time is: 2024-11-24 08:35:05