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 disappears after loading sprites

Author
Message
BobH0905
19
Years of Service
User Offline
Joined: 3rd Feb 2005
Location: Portsmouth
Posted: 4th Feb 2005 03:06
Hi, this is supposed to go in Newcomers Corner, but if it ends up somewhere else then I'm sorry, I must have done it wrong.
I've used DarkBasic succesfully and now I'm using the trial version of DBPro, so I don't have the printed manual.
Problem is that I loaded a background screen, and then placed sprites on, but the moment I placed sprites the background disappears.
I do this in DarkBasic and it works fine, but not in DBPro.
As a workaround, I made the background screen a sprite (DBPro seems to be fast enough for that) and all went well. I could load the background sprite and load and move sprites on it.
When I was testing, I needed to print the co-ordinates of a sprite and so tried to create a coloured box and PRINT the co-ordinates in it. Nothing appeared, so I used TEXT instead. Still no joy.
I've also used SYNC but to no effect. I've even tried not loading the background, in case my text was being displayed behind it, but no joy there either.
I've now tried all sorts of methods but nothing works up to now. I clearly need some vital bit of information that I can't find either in the HELP; in the forums; or on the 'net.
I'm sure that I've seen references to this kind of problem before, something to do with a 2D screen disappearing when sprites are placed on the screen in DBPro, but I can't find it.
Can anybody offer a suggestion to get me going again. At present I'm at a dead stop, and my trial days are counting down.
Hopefully just showing me how to load any sprite, display it anywhere on the screen, and the display some text on the screen should point me in the right direction, so I'm not attaching any of my (many) source code failures.
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 4th Feb 2005 05:32
Make sure your text command is in the main loop, so its being drawn each loop. Then make sure other sprites/images aren't placed above it.
Check that the text color isn't set to the same color as your background.

Seeing what your code looks like at the moment might help.
BobH0905
19
Years of Service
User Offline
Joined: 3rd Feb 2005
Location: Portsmouth
Posted: 5th Feb 2005 00:50
Thanks. Here's one test I did to try to see some text. If you can tell me how to see the text, I'll try to build on that info.
BobH0905
19
Years of Service
User Offline
Joined: 3rd Feb 2005
Location: Portsmouth
Posted: 5th Feb 2005 03:58
The source code I posted seems to be unavailable. It's only a few lines so I'm attaching it to this message as a snippet (I think)

BobH0905
19
Years of Service
User Offline
Joined: 3rd Feb 2005
Location: Portsmouth
Posted: 5th Feb 2005 18:31
I think I've sussed it. And I don't need to have the entire background as a full-screen sprite either.
It seems that I have to completely rebuild the entire screen in between uses of SYNC. I can't update part of the screen and SYNC, and then update the rest and SYNC again, because the screen rebuilds from the last SYNC.
I've been trying to display something, then SYNC to see it, with the result that everything else has disappeared. I had interpreted the use of SYNC to mean "ensure that the last action has been completed before adding anything else to the screen".
Thanks ReD_eYe, your first sentence made me think again at what I was doing.
One more thing though, I still can't get the TEXT command to show text "in front" of a sprite. Does anybody have any suggestions on that?

Login to post a reply

Server time is: 2024-11-27 20:30:07
Your offset time is: 2024-11-27 20:30:07