thanks xcert
an extract of the code is below, it uses a couple of functions makegfxtext & tweentext_xy
strange thing is it works most the time, then the odd occasion it fails and a character is left behind / is put out of place??
#constant dimbo_48ptssize 63
makegfxtext (800,"this is a test",dimbo_48pts,dimbo_48ptssize,1,513,439, -17, 1)
tweentext_xy(800,1,513,768,513,100,4,4,0.5,0.4)
do
refreshscreen()
loop
function makegfxtext (id,text$,font,size,alignment,x#,y#, spacing, visible)
if gettextexists(id) = 0
createtext(id, text$)
settextfontimage(id,font)
settextsize(id,size)
//use -1 to centre
if x# = -1
x# = (sw/2) - (gettexttotalwidth(id) / 2)
endif
if y# = -1
y# = (sh/2) - (gettexttotalheight(id) / 2)
endif
settextposition(id,x#,y#)
settextspacing( id, spacing )
settextalignment(id,alignment)
settextvisible2(id,visible)
endif
endfunction id
Function tweentext_xy(texttotween,tweennumber, x,y,x1,y1,tweentype_x,tweentype_y, tweendelaystart#, tweenspeed#)
SettextPosition(texttotween,x,y)
tweennumber = CreateTweenText( tweenspeed# )
if tweentype_x = 1 then SetTweenTextX( tweennumber, x, x1, TweenBounce())
if tweentype_x = 2 then SetTweenTextX( tweennumber, x, x1, TweenEaseIn1())
if tweentype_x = 3 then SetTweenTextX( tweennumber, x, x1, TweenEaseIn2())
if tweentype_x = 4 then SetTweenTextX( tweennumber, x, x1, TweenEaseOut1())
if tweentype_x = 5 then SetTweenTextX( tweennumber, x, x1, TweenEaseOut2())
if tweentype_x = 6 then SetTweenTextX( tweennumber, x, x1, TweenLinear())
if tweentype_x = 7 then SetTweenTextX( tweennumber, x, x1, TweenOvershoot())
if tweentype_x = 8 then SetTweenTextX( tweennumber, x, x1, TweenSmooth1())
if tweentype_x = 9 then SetTweenTextX( tweennumber, x, x1, TweenSmooth2())
if tweentype_y = 1 then SetTweenTextY( tweennumber, y, y1, TweenBounce())
if tweentype_y = 2 then SetTweenTextY( tweennumber, y, y1, TweenEaseIn1())
if tweentype_y = 3 then SetTweenTextY( tweennumber, y, y1, TweenEaseIn2())
if tweentype_y = 4 then SetTweenTextY( tweennumber, y, y1, TweenEaseOut1())
if tweentype_y = 5 then SetTweenTextY( tweennumber, y, y1, TweenEaseOut2())
if tweentype_y = 6 then SetTweenTextY( tweennumber, y, y1, TweenLinear())
if tweentype_y = 7 then SetTweenTextY( tweennumber, y, y1, TweenOvershoot())
if tweentype_y = 8 then SetTweenTextY( tweennumber, y, y1, TweenSmooth1())
if tweentype_y = 9 then SetTweenTextY( tweennumber, y, y1, TweenSmooth2())
PlayTweenText( tweennumber, texttotween, tweendelaystart# )
endfunction
function refreshscreen()
UpdateAllTweens( GetFrameTime() )
update(0)
render2dback()
render2dfront()
swap()
endfunction