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 / Scrolling Text

Author
Message
Kingy
19
Years of Service
User Offline
Joined: 25th Oct 2004
Location:
Posted: 5th Nov 2004 00:51
Hey im totally new to programming. I just wanted to ask a simple question about scrolling text. I can get the text to scroll to the right by using: x=0
y=240
sync
cls
do
text x,y,"Hello World"
sleep 50
cls
if x<=550
x=x+5
else
x=x-5
endif
loop
sync on

Can anyone help me to get the text to go back to the left. Cheers
Final Epsilon
20
Years of Service
User Offline
Joined: 26th Jan 2004
Location: CA, USA
Posted: 5th Nov 2004 05:06 Edited at: 5th Nov 2004 05:06
Here ya go. you needed to add a variable that shows if the text is currently moving right or left, and then move the text appropriately.

lickuidstylz
20
Years of Service
User Offline
Joined: 13th Aug 2004
Location: MD in USA
Posted: 5th Nov 2004 05:14
Your code is wrong becaus you're saying that if it's less than 550. If you try to get it to go to the left, the x position will still be less than 550 right? So what you do is set a boundary like this,

I'm not sure if that'll work (I'm at work right now and I can't test) but that formula should work. Also, lemme ask you, what does that "sleep" command do? Double as a frame rate controller or something?

Hope I helped,
The Guy

The only limits we have are those we set.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 5th Nov 2004 05:32 Edited at: 5th Nov 2004 05:33
sleep suspends execution like a wait statement.


DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!
Kingy
19
Years of Service
User Offline
Joined: 25th Oct 2004
Location:
Posted: 5th Nov 2004 22:31
Cheers for your help, i've got it working fine now. Thanks again

Login to post a reply

Server time is: 2024-09-23 04:29:30
Your offset time is: 2024-09-23 04:29:30