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.

DarkBASIC Professional Discussion / Putting Text over Sprites

Author
Message
Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 21st Nov 2010 05:09
Ok, so im making a program currently in development that is secret other than that Well, to the main point, i have set bitmap format to 21, allowing bitmap to keep the alpha channel on, and converted from bitmap to image, then to a sprite to allow resizing and transparency, but i'd like to be able to put text over a sprite, and it won't allow me.

i really appreciate all of you guy's help!

check my youtube channel at http://www.youtube.com/user/freeflightsimulator
Hodgey
16
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 21st Nov 2010 08:55
Hi, I can't see any text/print commands being used but I know that to display text (using the text commands) over a sprite, you need to use the 'Paste Sprite' command, preferably before you use the text commands. If the text is another sprite, then look up the sprite priority commands which control which sprite is displayed over which.

Hope this helps

A clever person solves a problem, a wise person avoids it - Albert Einstein
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 21st Nov 2010 12:07
If the text doesn't change you have the perfect opportunity to add the text right before GET IMAGE.



Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 21st Nov 2010 17:26 Edited at: 21st Nov 2010 18:31
Thanks to both of you humanly beings!

IM A TOTAL NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Nov 2010 20:50
You can do this using the standard DBPro commands (with a small restriction):


The restriction is that you have to let the sprites clear the screen (something that people usually switch off, using CLS instead), and everything appears on top of the sprites.

Another alternative which is more flexible, is to use 2 of my plug-in commands to tell DBPro exactly when to draw the sprites:


Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 21st Nov 2010 22:16
Nice!

IM A TOTAL NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 30th Nov 2010 13:42
I know I'm coming into the conversation a little late, but you could use "paste sprite" and then print your text after it. This would do exactly what you want it to do.

The fastest code is the code never written.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 30th Nov 2010 13:47
Apparently there have been some changes (by IanM) to how DBP draws sprites which makes "Paste Sprite" a little slower than "Sprite"...

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 30th Nov 2010 15:40
Really? Paste always used to be lots quicker! Most my games end up using sprite/textured plane fonts instead of text anyway as DB's text commands are not the fastest. A fair bit more work, but normally looks better as well.

http://s6.bitefight.org/c.php?uid=103081
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 30th Nov 2010 15:43
I use cloggy's d3d plugin for text most of the time. It can even make 3D text objects...

Darned quick too!

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 30th Nov 2010 17:11
But cloggys text doesn't work correctly if your using images/sprites.

If you place your sprites, then draw your d3d text it works. If you draw your text first, then draw a sprite/image then it appears white.

(Unless you use d3d start text, then draw your text, then d3d3 end text. But then it becomes just as slow as normal text...)

My signature is NOT a moderator plaything! Stop changing it!
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 30th Nov 2010 17:15
Quote: "Unless you use d3d start text, then draw your text, then d3d3 end text. But then it becomes just as slow as normal text..."

I only call the d3d_starttext and d3d_endtext once per display loop and haven't noticed any speed decrease but I'll certainly test it.

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 30th Nov 2010 17:25
As do I, but if you try and paste sprites/images then it messes up and the images appear white.
You have to paste all images before the first call to D3DStartText

My signature is NOT a moderator plaything! Stop changing it!
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 30th Nov 2010 17:42
Quote: "As do I, but if you try and paste sprites/images then it messes up and the images appear white.
You have to paste all images before the first call to D3DStartText"

I must already be doing that then as I've never had that problem. Colour me lucky!

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Nov 2010 19:34
Quote: "draws sprites which makes "Paste Sprite" a little slower than "Sprite""

Argh! Way to give the wrong impression

Rendering sprites is now a bit faster than pasting the equivalent number of sprites or images, and the difference increases as you increase the number of sprites - I didn't slow anything down.

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 30th Nov 2010 23:16
Nice!

New 3d marble game coming soon!
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 1st Dec 2010 10:09
Quote: "Argh! Way to give the wrong impression"

Right, bad way of putting it IanM sorry! Obviously you weren't making anything slower! My bad...

[correction]
Apparently there have been some changes (by IanM) to how DBP draws sprites which makes "Sprite" faster than "Paste Sprite"...
[/correction]

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Dec 2010 10:23
[b][/b]

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet

Login to post a reply

Server time is: 2026-07-21 16:43:43
Your offset time is: 2026-07-21 16:43:43