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 Discussion / Help with real time text command.

Author
Message
Satchmo
20
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 9th May 2007 14:33 Edited at: 9th May 2007 14:34
I am making a turn based battle system and have the program print all the variables(ie health,points )but this is during the main loop with everthing else running. For some reason they all appear flashy except when only printing one.

for example

and that would appear flashy
can someone please help?

RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 9th May 2007 15:20
...They're all going to be displayed overtop of each other...you're never increasing x :/.

Anyways, turn sync on using the SYNC ON command, and the flashiness will be gone. However you'll need to add a SYNC command before the loop command.

Looks to me like you need to read a few beginner tutorials... manually syncing and changing the text coordinates is some pretty basic stuff...

Satchmo
20
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 9th May 2007 15:27 Edited at: 9th May 2007 15:27
No i just put x there as a filler, ingame there not on top of each other
Quote: "for example"

But I didnt know the sync had much to do with text, I thought it only affected 3d. But I have looked at some tutorials and they helped a bit.thnx.

Satchmo
20
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 9th May 2007 15:30
This can be locked know. (I feel like such a newb, but thats what people like you are for!)

zenassem
22
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 9th May 2007 16:28 Edited at: 9th May 2007 16:37
You are not alone my friend.

These are my confessions....
It's actually a good thread. And it's great that you resolved it. Text and Print commands can get tricky in DBC and DBpro. There are times I needed, for whatever reason, to use a double sync command after text to get it to display. I can remember some of my text programs having 15 syncs thoughout the game loop when I started. I can't remember If I was ever able to fully resolve the issue.

I ran into other trouble (not sure if they are fixed now) when I used a wait key() command after a print statement in DBpro, even with syncs. The text doesn't show for me for some reason (it's like the program looks ahead to the wait key() command and stalls there without updating the screen.) then after the a key is pressed the text flashes quickly as the program continues executing.

For the reason's above, I decided to switch to bitmap characters, and wrote routines that I could use in all my programs to display results I needed. And if they were numerical values I'd convert them using the str$() command.

Text always seemed to throw off my FPS rate regardless of what I did, especially if I used color commands. Not sure if that was in DBC as well.


To be honest, I could actually use more help and instruction/code snippets in how to effectively use text and print statements inside a game loop. I still avoid them because of my early failures.

Is there any reason to avoid them the way I do????? Especially with delays for user input, for example?

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 9th May 2007 18:46
First of all, the Text/Sync association in DBC is entirely different to that in DBPro.

In DBC, a Sync refreshed the 3D camera view and zapped your text whereas in DBP they seem to have fixed this.

So, in DBC, you simply put your Sync at the end of the main loop and immediately on the next line issue your Text command. Job done - no disappearing text and no flickering.

I'm using the 2007 download version of DBC and it appears to be slightly different to the V1.13 I was using before with regards to Sync.

Programs which worked before now seem to be giving me 'flashing' white screens when first run - and periodically while the program is running.

But that's another issue...

TDK_Man

Satchmo
20
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 9th May 2007 23:07
Im also a big newb with the sync commands, I know them but there not a standard everytime thing for me yet-I just forget them.

Login to post a reply

Server time is: 2025-05-29 07:25:41
Your offset time is: 2025-05-29 07:25:41