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 / Need help inserting an image

Author
Message
Ad87am
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: England / London
Posted: 5th Aug 2005 23:39
I need to insert an image as a background for my menu, but dont know how to. I have go to the part were you write "LOAD IMAGE "BACKGROUND.BMP",1 and then in the loop "PASTE IMAGE 100,0,0" but it doesent work, i figured that i would have to tell the program were to find the image, not sure how to do that tho.

Thanks

Louiz ofRohr
19
Years of Service
User Offline
Joined: 11th Nov 2004
Location:
Posted: 6th Aug 2005 03:01 Edited at: 6th Aug 2005 03:06
You can do something like:



The sprites are drawn in sequence of creation
in the screen by default..
[EDIT]I mean that every new
sprite you create is gonna be
over the sprites drwan before.. =P

Hope that helps =]

The worst foe lies within the self...
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 6th Aug 2005 09:49
Ad87am,

In your example that you showed us, your background image loaded is image # 1. The image you are trying to paste is image # 100. This is your problem. Type paste image 1,0,0, and it should work correctly.

Also, if you paste the image each loop, you are not going to get a very good FPS(frames per second) count, maybe even down to only 20 fps. Therefore, right before the main loop, or just the loop, paste the background image once. Then, use sprites, for the menu's options images. This will indefinitely speed up your menu screen, to at least 60 fps.

Hope you understand. Ask me to clarify if you do not.


+NanoBrain+
Ad87am
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: England / London
Posted: 6th Aug 2005 13:43
That was actually a type error, i do actually have the name numbers matched up, 100,100, well noticed tho. How does DBP know were to find the image from on my computer? Do i not have to load them up somewere?

Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 6th Aug 2005 20:57 Edited at: 6th Aug 2005 20:58
simplest is to have the image inside the project folder, then DB will find it automaticaly, if it`s somewhere else (like another drive) then you should provide the full path, eg

load image "D:game development\images\terrain\ground.bmp",1

this will find the picture on drive D in the folder "game development" in the subfolder "images" in the folder "terrain", it will then load the file ground.bmp, do take care with long path names since it is easy to make a typo and spend ages trying to work out why the program can`t load the file you requested.
the easiest thing to do is to plonk em all in the program folder, maybe in subfolders of their own, then all you need to do is to do

load bitmap "bitmaps\ground.bmp",1

this just makes the program look into the project folder for the folder bitmaps and load the image from that, with DB you can place your data wherever you like according to what you intend to do, it`s down to you to make sure that the finished program can find the data you are telling it to load.

Ad87am
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: England / London
Posted: 6th Aug 2005 21:25
Thanks for that, i understand now. I have 2 seperate folders, Projects and Media. I will just put a subfolder in the projects folder.

Login to post a reply

Server time is: 2024-09-24 01:30:31
Your offset time is: 2024-09-24 01:30:31