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.

Dark GDK / dbText and dbSprite...

Author
Message
ErDa
16
Years of Service
User Offline
Joined: 17th Feb 2008
Location:
Posted: 24th Mar 2008 04:48
... do not go well together. As far as i understand, the dbSprite() command sets your game to "3d-world", but dbText() does only work in "2d-world", or something of the like. I was wondering if there's any work-arounds for this? Preferably something simple such as always drawing the text infront of the sprite.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Mar 2008 16:37
Sprites can be told to "draw to back", for performance you usually want to set "BackSave" to Off.

And when in 3d mode, your screen is getting cleared every sync, so to print something on the screen, use the dbSetCursor(x,y) to position and the dbText or dbPrint EVERY LOOP - and you'll see your text.

I'm not sure if draw sprites to back or whatever it is will help ya - if not you CAN cheat.

You can write the text once, capture the image of it (say white text on black background) - make a sprite of that, then set all the other (non text) sprites to a higher priorirty number WHICH ACTUALLY makes them draw first. The Higher the Priority value, the further back they from beging "on top" in the order they are draw,

Position (default) ZERO means TOPMOST. If all sprites default to ZERO (they do) then the order which they are drawn is really arbitrary.

ErDa
16
Years of Service
User Offline
Joined: 17th Feb 2008
Location:
Posted: 26th Mar 2008 00:16
Thank you for replying, this world could certainly need more helpful people like you. However I'm more or less completely new at DGDK/DB(P), and would love an example of how the second method would be done (especially how to capture an image of the text, make it into a sprite, and how to set priority numbers).

Also, when on the subjet of sprite-layers etc. I assume that sprites being on different levels won't have any impact on dbSpriteCollision? It's still not quite clear to me if the sprites with higher priority number as you say, gets drawn further back on the Z axis, or just appears to be behind.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 26th Mar 2008 01:28
Quote: "Thank you for replying, this world could certainly need more helpful people like you."
That made me feel good - thanx!

Quote: "However I'm more or less completely new at DGDK/DB(P)"
Welcome.

Quote: "Also, when on the subjet of sprite-layers etc. I assume that sprites being on different levels won't have any impact on dbSpriteCollision?"
I don't know - but I don't see how it would.

Quote: "It's still not quite clear to me if the sprites with higher priority number as you say, gets drawn further back on the Z axis, or just appears to be behind."
This would be further back in the Z-Order !!NOT!! the Z-Axis. (At least thats the Theory )

Quote: "would love an example... how to capture an image of the text, make it into a sprite, and how to set priority numbers"




How's That?

ErDa
16
Years of Service
User Offline
Joined: 17th Feb 2008
Location:
Posted: 26th Mar 2008 01:46
Excellent! Thanks a bunch, it's much clearer now.

Login to post a reply

Server time is: 2024-09-29 15:24:27
Your offset time is: 2024-09-29 15:24:27