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 / Text over sprites - sorry!

Author
Message
Kangaroo2
22
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 30th Jan 2003 01:45
Sorry to post a repeat question but I have been searching through the DBP and 2d forums and can't find the post about it

I want to use the Print command to write text ON TOP of a sprite. How do I get it to set the sprites a lower priority than the text, but still higher than 3d?

Any help appreciated, Thanks in advance
http://www.myminehead.com/mylogo.gif[/img]
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 30th Jan 2003 03:08
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 30th Jan 2003 03:44
Kanga - actually, I'm afraid it's not quite as straight forward as a single command (sorry indi!).

The answer to your question is this - you cannot print text ontop of a sprite that is ontop of 3D.

(not without locking the backbuffer and performing a direct memory draw anyway).

There are 2 options open to you:

1) Don't use a sprite, use "paste image" instead. Speed-wise there's no difference. The image will appear ontop of your 3D scene (because the default for DBPro is "draw to front" anyway) and if you then print text it'll appear ontop of the image. Unless you need sprite rotation or some such this is usually a better option.

2) You can have text on-top of a sprite IF the 3D is drawn ontop of the sprite too. Ironically though, the text will be drawn on-top of the 3D! So you'll have a (from back to front): sprite - 3D - text situation. To do this all you need is "draw sprites first" and "backdrop off" at the start of your program. If you don't disable the backdrop you'll soon find your sprites don't appear at all (because the 3D background initialised by your objects over-writes it all).

Hope that helps!

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 30th Jan 2003 10:02
ok so after looking at this problem I can see what u mean.


try this test and remark the two lines one at a time then in a combo





its a shame the sprite wont sit above the 3d in any command usage i tried here yet still being under the text, what could alleviate it in this example as you suggest Rich?

Kangaroo2
22
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 30th Jan 2003 14:28
Hmm, very useful suggestions I'll fiddle around and see what works best. Thanks Rich & Indi

Login to post a reply

Server time is: 2025-05-17 13:33:10
Your offset time is: 2025-05-17 13:33:10