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 / Noob Q - text over sprites?

Author
Message
FlimFlam
20
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 18th Jan 2005 08:27
Hello all, I am new here.

Currently developing a commercial product with DBPro, it's around 50% completed at this stage.

I have an important question though - is there any way I can get text to appear above sprites? I've looked all through the help and I can't seem to find any option which will cause text not to be overwritten by a sprite.

Thanks in advance for any replies, and apologies if this has been discussed before or is in the wrong section etc.
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 18th Jan 2005 09:17
have you looked into pasting the sprite?

FlimFlam
20
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 18th Jan 2005 12:46
Thanks for the reply, Nick.

I looked up the paste sprite command in the help but it appears that all that function does is relocate a specified sprite. I am already doing that with the sprite command in my drawing sub (Although I will probably now change to paste for speed reasons since it is solely for relocating whereas sprite is open to specifying a different image etc...)

However, my problem is that I am trying to get text, as in, output from the text or print command to appear over the top of a sprite in the background. Take for example, if you have a full screen size permanent background sprite, which gets refreshed every cycle - how do you get the text to be readable ABOVE that, rather than somehow be wiped out every frame? I was thinking along the lines of some sort of priority setting option, but the only one of those I could find that was relevant applied to sprites as well...

JeBuS
20
Years of Service
User Offline
Joined: 20th Jul 2004
Location: Undisclosed Location, Dominion of JeBuS
Posted: 18th Jan 2005 15:53
A lot of people recommend using sprites instead of / in place of your text. So each letter would be a sprite of its own. There's quite a few topics about that in this forum if you're interested.


High quality models and graphics, low prices. Graphics for the rest of us.
Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 18th Jan 2005 21:32
Have a look at the DRAW TO FRONT and DRAW TO BACK commands.

Also, you've misunderstood the paste sprite command. Paste sprite does not move an existing sprite, it creates a new image with the likeness of the original sprite.

The important part is that pasting a sprite results in an image, not a sprite, so you can safely TEXT over it.
FlimFlam
20
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 19th Jan 2005 20:31
Jebus - that is of course an option, but it seems like a hell of a lot of work just to get something simple like this to work!

Agent - I checked out draw to back. In fact I'd already seen it, but tried again on the off chance

I was thinking "Yeah this might do it" since it "makes sure all 2d" is drawn before 3d (I was under the impression sprites were 3d objects...) Alas, it didn't work.

Actually it seems that Nick's original answer may just be the best one - I had misread the paste command. But this means I have to go in and rewrite the meat of my drawing function

Well, thanks for all the help guys.

Login to post a reply

Server time is: 2025-06-01 09:52:11
Your offset time is: 2025-06-01 09:52:11