I'm not sure if this is the best way to handle this... I sort of do a little callback from the drawing routine for each character. it's works, I just haven't decide how elegant it is. :)
test app:
Download
here's the the test app code, the functions that do the work are Wave and Bounce which were passed as function pointers
test app:
Download
here's the the test app code, the functions that do the work are Wave and Bounce which were passed as function pointers
' load the pac Local pac:TPac = LoadPac("incbin::fontA.pac") ' point to the set that's named "font" Local font:TPacImage = pac.GetImage("font") Global i:Float = 40000 Local txt0:String = "Here's a neat little effect." Local txt1:String = "I'm not sure of the interface for this yet...~nI don't know if a 'callback' like this is the best way.~nBut it seems to work well.~nPRESS SPACE" While Not KeyHit(KEY_ESCAPE) Cls If KeyHit(KEY_SPACE) Then i = Rand(-50000,50000) SetScale 1,1 SetHandle font.TextWidth(txt0,-6,True)/2,font.TextHeight()/2 font.DrawText txt0,400,100,-6,True,False,Wave SetColor 255,255,255 SetHandle font.TextWidth(txt1,0,False)/2,font.TextHeight()/2 font.DrawText txt1,400,350,0,False,False,Bounce SetHandle 0,0 SetScale .65,.65 font.DrawText i,0,0 Flip Wend Function Wave( x:Float Var, y:Float Var, pos:Int ) SeedRnd pos SetColor Rand(255),Rand(255),Rand(255) Local d:Float = Float(MilliSecs())/5.0 y = Sin(d+Float(pos)*35.0)*20.0 SeedRnd MilliSecs() End Function Function Bounce( x:Float Var, y:Float Var, pos:Int ) If Int(i) > 0 Then i:-1 If Int(i) < 0 Then i:+1 x = Cos(pos*10.0)*(i*.01)*Cos(Float( i )/500.0*pos) y = Sin(pos*10.0)*(i*.01)*Cos(Float( i )/500.0*pos) End Function