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.

2D All the way! / Using Text

Author
Message
Strife
21
Years of Service
User Offline
Joined: 11th Dec 2002
Location:
Posted: 24th Mar 2003 07:00
I have a big problem with Text. If i change the text size more than 2 times in a Do...Loop and compile that and run it, the text will blink in 2 different sizes (1 of the sizes is the text size i picked). Anyone know how to fix this or why it happens. Im using DB classic
Strife
21
Years of Service
User Offline
Joined: 11th Dec 2002
Location:
Posted: 24th Mar 2003 18:18
Dim P2UnitNme$(1)
Do
ink rgb(0,0,0),1:Box 0,0,1023,767
ink rgb(1000,1000,1000),1:Set Text Size 38:Set Text Font "Arial"
Text 300,50,"Player Two:"
Text 400,100,"Choose Your Race:"
Set Text Size 20:Set Text Font "Arial"
Text 500,200,"1) Elves"
Text 500,250,"2) Dwarves"
Text 500,300,"3) Random"
Set Cursor 500,380:Input "->",Ans
If Ans=1 Then P2UnitNme$(0)="Elven Fortress":Exit
If Ans=2 Then P2UnitNme$(0)="Dwarven StrongHold":Exit
If Ans=3
RandRace=Rnd(1)+1
If RandRace=1 Then P2UnitNme$(0)="Elven Fortress"
If RandRace=2 Then P2UnitNme$(0)="Dwarven StrongHold"
Exit
Endif
Loop

Here`s my code for 1 of my menus, just copy and compile it and run the .exe

exhaulted
21
Years of Service
User Offline
Joined: 27th Mar 2003
Location:
Posted: 27th Mar 2003 15:04
I cant compile the code cus im at work but (tell me if im wrong!),
cant you print all of the text on the screen outside of the loop and then just loop to get the input??

That way all of the text stays on screen, all you are looping for is to wait for input from the user!

exhaulted
21
Years of Service
User Offline
Joined: 27th Mar 2003
Location:
Posted: 27th Mar 2003 15:05
Like this?

ink rgb(0,0,0),1:Box 0,0,1023,767
ink rgb(1000,1000,1000),1:Set Text Size 38:Set Text Font "Arial"
Text 300,50,"Player Two:"
Text 400,100,"Choose Your Race:"
Set Text Size 20:Set Text Font "Arial"
Text 500,200,"1) Elves"
Text 500,250,"2) Dwarves"
Text 500,300,"3) Random"


DO
Set Cursor 500,380:Input "->",Ans
If Ans=1 Then P2UnitNme$(0)="Elven Fortress":Exit
If Ans=2 Then P2UnitNme$(0)="Dwarven StrongHold":Exit
If Ans=3
RandRace=Rnd(1)+1
If RandRace=1 Then P2UnitNme$(0)="Elven Fortress"
If RandRace=2 Then P2UnitNme$(0)="Dwarven StrongHold"
Exit
Endif
LOOP

Strife
21
Years of Service
User Offline
Joined: 11th Dec 2002
Location:
Posted: 30th Mar 2003 06:23
Yeah i know it shouldnt be in a loop, but that doesnt actually matter. If you do that and still compile it and run .exe, the text will blink to different text sizes. This only happens in the compiled .exe. It nevers happens in Dark Basic. Thats why it is very confusing.

trager
21
Years of Service
User Offline
Joined: 5th Feb 2003
Location: United Kingdom
Posted: 3rd Apr 2003 12:03
I've had a simular problem in the past I don't know exactly how I solved it then but these days I tend to put all text onto sprites and then just display the sprites as and when I need them.

This method overcomes certain speed issues associated with changing text size and colour. Consider for example that when you have a full screen of text you can almost see it scrolling down the screen as it is being generated, sprites appear all in one sync.

In short lots of benifits in using sprites and image files for text.

There is no answer only more questions.
trager
21
Years of Service
User Offline
Joined: 5th Feb 2003
Location: United Kingdom
Posted: 3rd Apr 2003 12:05
that said I wonder if just syncing will help you?

There is no answer only more questions.
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 3rd Apr 2003 22:48
I have a problem exactely like that with my retro game and I cannot fix it. I can't print sprites on the screen or it slows my game down and I cannot use changing digits easily.

Why the hell'd you ask me for crying out loud!?!

Login to post a reply

Server time is: 2024-04-18 13:57:07
Your offset time is: 2024-04-18 13:57:07