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 / Sprites vs bitmap

Author
Message
Yitzu
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 23rd Feb 2010 00:17
I have a little problem, When i try to load a bitmap to my code, once it reach the sprites, it will dissapear, the code is a little too big, so ill make an example.

I have something like this


Ive tried putting it after the image, after the sprite and other things, but when it reach a sprite it dissapear, y? and how can i fix it? Ty
Mew151
16
Years of Service
User Offline
Joined: 1st Jun 2008
Location: Glitch city
Posted: 23rd Feb 2010 01:20
It's because you're loading the bitmap number as 0, and the bitmap 0 is reserved for the screen.

Also the bitmaps can only be .bmp files.

Yitzu
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 23rd Feb 2010 01:56
Ok, I changed it to a bmp. file, and I putted the bitmap number as 1, but now the bitmap wont appear on the screen, it just appear as a black screen. =/

Why does that happen?
Mew151
16
Years of Service
User Offline
Joined: 1st Jun 2008
Location: Glitch city
Posted: 23rd Feb 2010 03:24
You have to display the bitmap on the screen.

There are many ways to do it.
The easiest in my opinion is to turn it into a sprite, because you have a lot more freedom.

You can also turn it into a normal image and use the PASTE IMAGE command.

Or you can use the COPY BITMAP command and copy it to bitmap 0.

Yitzu
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 23rd Feb 2010 04:40
XD

U know i made those 3 things u told me before, I kinda liked to make it into a sprite, but the only problem was that it appeared first than the other ones, so u couldnt see the other sprites, is there any command or code to see that sprite in the back, and the others in the front? Ty
Yitzu
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 23rd Feb 2010 05:44
Ok, i solved it =D
I used the Set sprite priority command, rly useful, anyways, ty a lot, u rly helped
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Feb 2010 12:29 Edited at: 23rd Feb 2010 12:39
Actually, Load Bitmap is misleading because 'Bitmap' in DB should be read as 'screen'.

There are 32 screens - 0 is the one you see and the other 31 are hidden. You can load an image containing multiple graphics into one of these screens and cut sections from it without the user seeing it.

Another use is with Create Bitmap and building up a screen unseen by the user - when finished, you copy it to the visible screen (0).

Unless you need to do either of these things, (or have another unavoidable reason), don't use Load Bitmap, use Load Image instead.

Load Bitmap, unlike Load Image, doesn't actually store the image anywhere for re-use. Clear the screen after Load Bitmap and you have to re-load it to see it again. Load Image on the other hand lets you use Paste Image as many times as you like afterwards.

So, loading a bitmap and then grabbing a single image is a waste of time when Load Image does the job in a single step.

TDK

Yitzu
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 23rd Feb 2010 13:44
ok, ty for the info

Login to post a reply

Server time is: 2024-09-28 14:26:57
Your offset time is: 2024-09-28 14:26:57