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 / sprite not showing up

Author
Message
lovecraft58
4
Years of Service
User Offline
Joined: 30th Nov 2014
Location: United States
Posted: 3rd Feb 2015 19:45
Can anyone tell me why the arrowtrans.bmp isn't showing up? This is from "Hands On DBPro".



Nick Z.

TheComet
11
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 3rd Feb 2015 22:01
Does it show up if you do this?



The only way to do great work is to love what you do -- Steve Jobs
WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 4th Feb 2015 02:42 Edited at: 4th Feb 2015 02:44
The two things I notice right off the bat, is improper sprite priority and the fact that a for/next loop does not update the display.

By default DarkBasic Professional will draw the sprite with the lowest image number first. So, a sprite using a higher image number will be displayed on top of a sprite with a lower image number. You can use Set Sprite Priority to change this behavior.

Whether sync or the backdrop is on or off, DBPro still uses double buffering. In you code rendering the sprite will turn the backdrop on but, you are still not using sync. Under this condition certain other functions will flip the backbuffer. A for/next loop will not do this. However, if changed to a while/endwhile loop the backbuffer will get displayed.

WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 4th Feb 2015 03:17 Edited at: 4th Feb 2015 03:19
Disregard the second part of that post. It would appear a for/next loop updates the display as well.
lovecraft58
4
Years of Service
User Offline
Joined: 30th Nov 2014
Location: United States
Posted: 4th Feb 2015 06:29
TheComet, yes it does. It also works without the background, so the background is the problem?

Nick Z.

pcRaider
12
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 4th Feb 2015 07:10 Edited at: 4th Feb 2015 07:12
test code
set sprite priority 1,100


windowsXp
WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 4th Feb 2015 13:38
The problem is not the background. It's that the background is using a higher image number then the arrow.
lovecraft58
4
Years of Service
User Offline
Joined: 30th Nov 2014
Location: United States
Posted: 4th Feb 2015 15:13
Thank you all. Now I understand.

Nick Z.

Login to post a reply

Server time is: 2019-10-15 13:31:56
Your offset time is: 2019-10-15 13:31:56