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 / Text over a sprite

Author
Message
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 28th Aug 2006 14:36
I have a question- How can I get text to appear over a sprite? It always seems to appear under...

demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 28th Aug 2006 16:17 Edited at: 28th Aug 2006 16:22
ok i don't know the actual code required but i think you can just write the text to a bitmap and then make that into a sprite and put that on top... it might not be the most efficient way to do it though...


i'm trying to figure out the code for it now i'll edit this post if i can


EDIT:



try that

RIP Dimebag
http://db1games.topcities.com
(used to be demonsbreath)
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 28th Aug 2006 17:24 Edited at: 28th Aug 2006 17:25
Thx for the input but...
That makes text, but the sprite goes on top of it. I think the only way may just be to use sprites and SET SPRITE PRIORITY.

demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 28th Aug 2006 17:53
well just use that code but instead of making it an image make a sprite or something... i don't know...

RIP Dimebag
http://db1games.topcities.com
(used to be demonsbreath)
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 28th Aug 2006 21:49 Edited at: 28th Aug 2006 21:49
Placing text on top of sprites is not possible. You will need to make the text into an image and then use that image as a sprite to put on top of the background sprite.

You could do it in a similar way to demons breath but using the correct width and height instead of an arbitrary 200 pixels like this:


Alternatively, you could download some of my bitmap fonts and use them. There is also code to show you how to use them. You can find them in the Free Media thread.


Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 28th Aug 2006 22:24
Or, you could use 3D Plains instead of sprites.

Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 28th Aug 2006 22:44
No you couldn't ... 3D plains appear beneath sprites.


Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 28th Aug 2006 22:47
I ment to replace the sprites

Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 29th Aug 2006 03:27
Cool thanks. I hate how sprites are screen hogs... Wish setting the priority to -1 would make it appear behind text and -2 behind 3D. Ah well thanks all.

Cave Man
18
Years of Service
User Offline
Joined: 22nd Aug 2006
Location: North Carolina, US
Posted: 30th Aug 2006 02:59
I know im late and all, but the solution is using paste sprite then using text



Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 30th Aug 2006 03:47
Oh! I can do that and then hide the real sprite! Thanks Cave Man! (lol your avatar matches your name)

Cave Man
18
Years of Service
User Offline
Joined: 22nd Aug 2006
Location: North Carolina, US
Posted: 30th Aug 2006 17:22
Glad i could help. lol, i thought this was like a month old, which is why i said i was late.

dawchiks
19
Years of Service
User Offline
Joined: 23rd Dec 2004
Location:
Posted: 10th Oct 2006 17:28
i opened my pic in photoshop, addne some text , and i am happy now

Making FPS!!!!
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 11th Oct 2006 01:45
Wow, that was a huge bump

Ummm...
yaarj
18
Years of Service
User Offline
Joined: 3rd Jun 2006
Location:
Posted: 11th Oct 2006 06:31
Well... You could use semi-transparent sprites. That way, you'll be able to see the text under the sprite. I'm using this method and I kinda like the effect.

Have fun in whatever you do, no matter how sad it is.
Code Dragon
18
Years of Service
User Offline
Joined: 21st Aug 2006
Location: Everywhere
Posted: 29th Oct 2006 03:55
Quote: "the solution is using paste sprite then using text"


I know I'm late also, but I'll post anyway because my question isn't worth a whole new thread.

Will paste sprite work if there are other sprites behinde the text? I've heard that the way sync works is to draw the sprites on top of the other 2d drawing, so the pasted image would be overwritten. Is there anyway to do this without hiding all the sprites behind the text and pasting them instead? Maybe backsave?

I made a text box which uses a bitmap to display text, but it was buggy, which is probobly why I didn't get too much feedback.

http://forum.thegamecreators.com/?m=forum_view&t=90039&b=1.

Confucius Say...

Login to post a reply

Server time is: 2024-11-12 14:33:18
Your offset time is: 2024-11-12 14:33:18