here you go, everything all rolled into one demo...moving, fading, incrementing by 20 every second...
// Project: Test2
// Created: 2016-08-26
// set window properties
SetWindowTitle( "Test2" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
global myValue as float //Float for accuracy
global myIncrement as integer
global myText as integer[5]
myValue = 5 //current value
myIncrement = 20 //increment per second
for i = 1 to 5
myText[i] = CreateText("")
SetTextAlignment(myText[i],2)
SetTextSize(myText[i],80)
SetTextPosition(myText[i], GetVirtualWidth() / 2.25, GetVirtualHeight()/2)
SetTextColorAlpha(myText[i],0)
next i
myTween=CreateTweenText(3)
SetTweenTextAlpha(myTween,255,0, TweenEaseOut2())
SetTweenTextY(myTween, getTextY(myText[1]), getTextY(myText[1]) - 150,TweenEaseOut2())
lastTime# = Timer()
thisText = 0
do
myValue = myValue + (myIncrement * GetFrameTime())
for i = 1 to 5
SetTextString(myText[i], str(myValue, 0))
next i
if timer() > lastTime# + 1.5
lastTime# = timer()
inc thisText,1
if thisText > 5 then thisText = 1
PlayTweenText(myTween, myText[thisText],0)
endif
Print( ScreenFPS() )
UpdateAllTweens(GetFrameTime())
Sync()
loop
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt