Hi There
I've been writing a short 3D scrolling text Demo using Cloggy's D3dfunc.dll
Can anyone tell me how I can use the restore command to start my message from the beginning again once it has finished scrolling.
I cant figure out where the restore command should go in my program?
Rem Project: My 3d scrolling text demo v.1.02
Rem Created: Friday, November 25, 2011
Rem ***** Main Source File *****
Rem Project: my 3d Text Test
Rem Created: Thursday, November 24, 2011
Rem ***** Main Source File *****
sync on : sync on : sync rate 60 : cls : set display mode 1024,768,32 : set window on :set window position 100,100 : set ambient light 0
color backdrop rgb(000,000,000)
scrollspeed#=0.04
x#=16
set point light 0,0,0,500
color light 0,512,512,512
set light range 0,1000
position light 0,0,0,0
D3D_Init 1
D3D_FONT 1,"impact",32,0,0,1
D3D_MAKE_3DTEXT 501, 1,"Hello and welcome.",0.1,0,1
scale object 501,150,150,150
color object 501,rgb(200,200,0)
position object 501,x#,-6,10
do
if object exist (501)=0 then gosub reassign1
if object exist (502)=0 then gosub reassign2
if object exist (503)=0 then gosub reassign3
move object left 501,scrollspeed#
move object left 502,scrollspeed#
move object left 503,scrollspeed#
if object position x(501) < -30 then delete object 501
if object position x(502) < -30 then delete object 502
if object position x(503) < -30 then delete object 503
sync
loop
reassign1:
read message$
D3D_MAKE_3DTEXT 501, 1,message$,0.1,0,1
scale object 501,150,150,150
color object 501,rgb(200,200,0)
message1size#=OBJECT SIZE X(501)*0.75
message1Xpos#=object position x(501)
message3size#=OBJECT SIZE X(503)*0.75
message3Xpos#=object position x(503)
position object 501, message3Xpos#+message3size#+message1size#+0.5,-6,10
return
reassign2:
read message$
D3D_MAKE_3DTEXT 502, 1,message$,0.1,0,1
scale object 502,150,150,150
color object 502,rgb(200,200,0)
message1size#=OBJECT SIZE X(501)*0.75
message1Xpos#=object position x(501)
message2size#=OBJECT SIZE X(502)*0.75
message2Xpos#=object position x(502)
position object 502, message1Xpos#+message1size#+message2size#+0.5,-6,10
return
reassign3:
read message$
D3D_MAKE_3DTEXT 503, 1,message$,0.1,0,1
scale object 503,150,150,150
color object 503,rgb(200,200,0)
message2size#=OBJECT SIZE X(502)*0.75
message2Xpos#=object position x(502)
message3size#=OBJECT SIZE X(503)*0.75
message3Xpos#=object position x(503)
position object 503, message2Xpos#+message2size#+message3size#+0.5,-6,10
return
end
Data "This is a new scrolling demo that I have been working on"
data "that uses Cloggy's D3DFunc.dll to make objects out of the text"
data "which are then scrolled left across the screen useing the standard"
data "move object left command. The objects are then destroyed when they"
data "pass off the left side of the screen and re-positioned off screen"
data "on the right next to the last part of the message. Finaly a routine"
data "is used to detect if the object has passed off of the screen"
data "before being deleted. This message will now end ..............."
data ".................................................................."
data ".................................................................."
"There are no perfect ideas only perfect intentions"