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 / Newbie question about text.

Author
Message
gcarlson53
14
Years of Service
User Offline
Joined: 15th Feb 2010
Location: Suitland, MD
Posted: 14th Feb 2011 07:03
I displayed an image and then I wanted to put text on top of that image. I used the void dbText ( int iX, int iY, char* szString ) command and it works but the problem I'm having is that I want the text to appear on top of the image instead of behind it. How do I do this?

[url="http://egregiousgames.blogspot.com"]My blog![/url]
[url="http://www.filesend.net/download.php?f=5a6a23f4e21d1a36bfcc0fefa22e14d4"]My Game![/url]
_Pauli_
AGK Developer
14
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 14th Feb 2011 13:04
Just use the text command after you have put the image on screen:



Now the plot thickens, the fps decreases, and the awesomeness goes through the roof.
gcarlson53
14
Years of Service
User Offline
Joined: 15th Feb 2010
Location: Suitland, MD
Posted: 14th Feb 2011 15:38 Edited at: 14th Feb 2011 18:20
Ohhh. I should have thought about that. Thanks a lot!

Edit:
I did dbSprite ( 1, 20, 360, 1 );
And then dbText ( 30, 370 );

And it sill doesn't work...


_Pauli_
AGK Developer
14
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 14th Feb 2011 21:29
I think this command may help:



Call this once in your program setup to make all sprites being drawn first. All other 2D drawing such as text, pasting images, etc. should then be on top of the sprites.

Me, I do it differently:
First I load and setup all the sprites. Then I hide them all (dbHideAllSprites()). To draw the sprites like the other 2D stuff I use dbPasteSprite(). This will give you more control over your draw order.

Now the plot thickens, the fps decreases, and the awesomeness goes through the roof.

Login to post a reply

Server time is: 2024-06-23 02:32:07
Your offset time is: 2024-06-23 02:32:07