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 / Newbie : HOW to display text over sprites?

Author
Message
JARS
20
Years of Service
User Offline
Joined: 15th Jul 2004
Location:
Posted: 14th Oct 2005 09:11
I know, its a newbie question. How do you display text over sprites in 2d graphics mode? Stupidly, I've been struggling with this issue for months and even thought about making my own font (etc) but I figured if there is a way to make it, it would be much more simple.
Because print and text (x,y) don't seem to work, I assume I must craft my own function?

Thanks reading.

J.A.R.S.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 14th Oct 2005 15:15
CENTER TEXT SPRITE X(Sprite Num),SPRITE Y(Sprite Num)-(SPRITE HEIGHT(Sprite Num)/2),"String"

That wont work for you?


UFO
18
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 14th Oct 2005 16:52
Quote: "CENTER TEXT SPRITE X(Sprite Num),SPRITE Y(Sprite Num)-(SPRITE HEIGHT(Sprite Num)/2),"String""

Yea, that is what I was thinking.[
JARS
20
Years of Service
User Offline
Joined: 15th Jul 2004
Location:
Posted: 14th Oct 2005 18:24
what this command does is simply use :
TEXT (x,y) "string"
where you put the argument X to be equal to the X location of the sprite and Y to the Y location of the same selected sprite (without the sprite height to make it centered). That's a lot more than I needed. The problem isn't finding the sprite, the problem is simply to DISPLAY TEXT over any sprite at all. Maybe my version's files got corrupted, but I never got the chance to succeed with this.

Whenever I put a text (x,y) "text" and there are sprites displayed, I just won't see any text at all, it is like it is transparent. I tried negociating with font sizes but nothing did it...

Hope this clarifies my question?

http://angelsearth.port5.com
http://www.stationz.co.uk/
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th Oct 2005 19:01
If the text doesn't change, before you use the image to create the sprite, paste it onto Bitmap 1 (hidden), then put the text on the image before you re-grab it to make the sprite with.

TDK_Man

JARS
20
Years of Service
User Offline
Joined: 15th Jul 2004
Location:
Posted: 14th Oct 2005 19:19
Can you be more precise about this procedure please?
I'm getting the overall idea but a concrete example could help...

http://angelsearth.port5.com
http://www.stationz.co.uk/
DrWez
18
Years of Service
User Offline
Joined: 28th Sep 2005
Location: United Kingdom
Posted: 14th Oct 2005 21:37
I had this problem and searching the forums found this code by Ric


To use just type text_over_sprite(SpriteNumber,Xpos, Ypos,Text)
The Spritenumber is any number that you are not using in your code
Xpos and Ypos are the coordinate like text x,y
Text is a string with your text in
I had to use bitmap 31 as DBC wont let me go any higher,the original uses 100 (i think)
If your are using DBPro I think you have to set the sprite priority at the end of the function to make it appear at the front

Got VB, Got VC, Worried about the next one
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 14th Oct 2005 22:57
This is primitive but it's exactly what TDK is talking about (just threw it together).

Login to post a reply

Server time is: 2024-09-24 05:28:41
Your offset time is: 2024-09-24 05:28:41