Sub Process_Globals
Dim FrameSizeX = 100 As Int 'in pixels
Dim FrameSizeY = 100 As Int 'in pixels
Dim MaxNumFrames = 5 As Int
Dim ActiveFrame = 0 As Int
Dim OutputSizeX = 10%x As Double
Dim OutputSizeY = ...
...
End Sub
Sub Timer1_Tick
'Sprite Animator
Dim InputX = ActiveFrame * FrameSizeX As Int
Dim InputY = 0 As Int
Dim Frame As ????? '<--- is this possible in B4J???
Frame.SetSource(InputX, InputY, FrameSizeX, FrameSizeY)
Frame.Draw(OutputX, OutputY, OutputSizeX, OutputSizeY)
ActiveFrame = ActiveFrame + 1
If ActiveFrame > MaxNumFrames Then ActiveFrame = 0
End Sub