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 / Problem displaying score

Author
Message
TheMan
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: Florida
Posted: 15th Aug 2008 19:22
Hello,

I'm having a problem displaying the score in the top left corner of my 3d game. The code i use is simple : Score = 0
Print Score. It should work, but instead it doesn't show up. Am i doing it wrong?
Slayer93
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 15th Aug 2008 20:28
It is hard to see what the problem is if you don't show any code

Nano brain
16
Years of Service
User Offline
Joined: 7th May 2008
Location:
Posted: 16th Aug 2008 01:19 Edited at: 16th Aug 2008 01:21
If your clearing the screen each loop, or if the 3d backdrop is on(due to the creation of sprites, the handling of 3D objects, or by manually turning the backdrop on), then you must reprint the text each loop. If not then what is printed will be cleared off the screen after the loop it is printed in.

Or, have you turned sync on(sync on)? If so then your text may not be appearing on screen because you haven't called the sync command after printing the text. If so, then place sync at the end of your loop.

These are a couple of the basic and common reasons why your print function wouldn't be showing up. If this doesn't help, then you need to post your code here so that we can analyze it and help you figure this out.
TheMan
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: Florida
Posted: 16th Aug 2008 16:35
I turned off the backdrop, it shows the score now, but it draws everything all weird if I turn or something.
Silver Wolf276
17
Years of Service
User Offline
Joined: 15th Feb 2007
Location:
Posted: 16th Aug 2008 18:57
I believe using "Print" only shows the text for a short second (well for me it seems to )
Use the Text command that WindowsKiller described.
Slayer93
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 16th Aug 2008 22:20
Quote: "I turned off the backdrop, it shows the score now, but it draws everything all weird if I turn or something."


You have 3D objects on your screen then right? The backdrop sort of clears the screen after every sync so if you turn it off then it would show what it rendered last frame and just render the next frame without clearing the screen. The backdrop also doesn't just clear 3d objects but text and images too so if you don't see the score then I'm guessing that means you didn't put print in the loop and instead outside of it?

If it is outside just put it on the inside but print makes a newline each time so I would also use text instead of print like WindowsKiller said.

Hope that helps.

TheMan
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: Florida
Posted: 17th Aug 2008 00:33
Thanks guys, it worked.

Login to post a reply

Server time is: 2024-09-27 18:24:56
Your offset time is: 2024-09-27 18:24:56