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 / drawing text over sprites

Author
Message
oneiro naut
16
Years of Service
User Offline
Joined: 19th Aug 2008
Location:
Posted: 30th Aug 2008 01:45
right now, i'm having quite a time trying to figure out how to draw text in front of a sprite. by default, sprites are drawn in front of text, is there a way around this?
thanks. :}
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 30th Aug 2008 02:13
Is the sprite a background? If so use Paste Sprite to put u'r background in.

Failing that make a sprite of the text.

Hope that helps

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
oneiro naut
16
Years of Service
User Offline
Joined: 19th Aug 2008
Location:
Posted: 30th Aug 2008 05:06
thanks bro. it was, indeed, for a background.

what i ended up with is



so it worked, but i'd like to ask why it worked; what exactly does the 'paste sprite' command do?

thanks for the help. :}
Ian G
16
Years of Service
User Offline
Joined: 3rd Jun 2008
Location: SSM, Canada
Posted: 30th Aug 2008 06:12 Edited at: 30th Aug 2008 06:14
hiding the sprites and using the Paste Sprite command to manually draw them is the most common way, but I have used Ian M's dlls to create a callback function to draw text in front of sprites in some of my applications.

for example:


Matrix Utils Link
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 3rd Sep 2008 00:53 Edited at: 3rd Sep 2008 00:56
Quote: "PASTE SPRITE

This command will paste the sprite image to the screen, at the specified coordinates. The sprite image
pasted to the screen is identical to the current state of the sprite, taking into account scaling, flipping and
mirroring. "


Okay time for an analogy that may or may not help you at all :

Think of a sprite as the light from a flashlight and your text as a sticker. Also, think of a white piece of paper on which you will put the sticker as your screen. Now, when you shine a flashlight straight down onto the piece of paper, the light appears on top of everything, including any stickers you have put on the paper. The PASTE SPRITE command turns the sprite (a.k.a the flashlight light) into a sticker so you can put it on the paper without it going on top of everything. Now you can put text stickers on top of the sprite stickers if you like! However, the sprite (a.k.a the flashlight light), it will still appear on top of everything including the sprite sticker we just put on the page. That is why we must delete or hide it using the DELETE SPRITE or HIDE SPRITE command .

I hope that made sense.

Ed222
16
Years of Service
User Offline
Joined: 3rd Nov 2007
Location: Calgary
Posted: 3rd Sep 2008 01:15
From Windowskiller http://forum.thegamecreators.com/?m=forum_view&t=135411&b=1
Quote: "create a bitmap, print the text onto that, turn the bitmap into an image (using GET IMAGE), and then use that image to turn the text into a sprite. Use TEXT SIZE to make the bitmap just as small as needed so you're not wasting performance or memory. If you write a function to do all this, you'll end up having a very easy way to display text ontop of sprites."

Or you could do what windows killer said above because if you use paste sprite then you'll have to paste every sprite on the screen thats on top of the text.

Login to post a reply

Server time is: 2024-09-27 20:30:14
Your offset time is: 2024-09-27 20:30:14