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.

Code Snippets / tip for when using PRINT command

Author
Message
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 7th Dec 2002 18:10
Hi All,

Here's a tip when using the print command.

if you type this in :

for i = 1 to 100
set cursor 10,10
print i
wait 800
next i

you will not be able to read the output, howevery if you put:-

Set Text Opaque

this will set the background to the background color and the above code will then show the numbers cleary.

save using cls and rediplay every thing again.

cheers
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 8th Dec 2002 03:13
that wont be pretty if the 2nd text information being over lapped is longer than the first.

update a variable
eg: output$ = "your have reached stage"+STR$(stagenum(1))

If u have a 3d game its easy u just position it where ever u want on screen.

If its a 2d game then its probably wiser to clear the screen with a box if its a smaller amount of text.

You could also use a 3d plain on the screen with the info grabbed as an image.

Your method is sloppy in a main loop

wait 1 would do the same thing but it would jitter.

HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 8th Dec 2002 17:07
I know its not pretty, but it will save on redoing the whole screen again when all you wanted to do is redisplay same text again,

like a clock time display, gets around making a box to clear it plus if you kown your over all text lenght you would take the string$ being printed away from the lenght of displayed string$.

with opaque on this work in four lines

set text opaque
do
text 10,10,get time$()
loop

other codes will make it a bit longer to type in.
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 9th Dec 2002 02:14
As you can see in this example if the 2nd string is longer like i said before it over laps.

set text opaque

a$= "abc"
b$= "zzzzz"
c$= "1234567891"

text 10,10,c$

text 10,10,b$

text 10,10,a$

sync
suspend for key
end


your method is flawed and useless unless u remove or hide the underlying text from the last result

Login to post a reply

Server time is: 2024-03-28 20:03:10
Your offset time is: 2024-03-28 20:03:10