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 / Sprite transparency & text display

Author
Message
zydeoN
14
Years of Service
User Offline
Joined: 25th Sep 2009
Location:
Posted: 11th May 2010 01:08
Hey, having problems with displaying text over a sprite (which shall be the game's hud). I applied a transparency to the sprite using dbSetSpriteAlpha(), but the text displayed over it gets darker accordingly to the sprite.
Here is an example:



How do it display the text over the sprite, instead of inside (as it looks like) ?
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 11th May 2010 08:53
Is the whole HUD transparent? Because I think the text is actually under the sprite, not over it. To draw text above sprites, there are a few options you can try:

Hide the sprite and display it with dbPasteSprite instead of dbSprite, then draw the text after pasting the sprite. This way you can control the drawing order.

I don't know if dbPasteSprite will correctly handle the transparency. If it doesn't, you can also try to write the text over the image itself and then make the sprite from the modified image.

In another forum thread, I read that if you use native DirectX text, then it displays above sprites. Maybe you can try Hassan's text plugin:

http://forum.thegamecreators.com/?m=forum_view&t=167715&b=22

Have a look at this thread as well:

http://forum.thegamecreators.com/?m=forum_view&t=169931&b=22
zydeoN
14
Years of Service
User Offline
Joined: 25th Sep 2009
Location:
Posted: 11th May 2010 16:17
dbPasteSprite before text is perfect thank you

Login to post a reply

Server time is: 2024-07-07 01:31:17
Your offset time is: 2024-07-07 01:31:17