Setvirtualresolution(640,480)
ResetTimer()
//Create Four Images, 11 to 14
Dim x[3]=[16,31,16,0]
Dim y[3]=[0,16,31,16]
Swap()
For i=0 to 3
Drawline(16,16,8,24,0,255,0)
Drawline(16,16,x[i],y[i],255,255,0)
Update(0)
Render()
GetImage(i+11,0,0,31,31)
ClearScreen()
Next i
//Create Sprite Frames
id=CreateSprite(11)
For i=11 to 14
AddSpriteAnimationFrame(id,i)
Next i
//Set Background
SetClearColor(50,50,100)
SetSpritePosition(id,100,100)
//Start Animation
PlaySprite(id,2)
AddVirtualButton(1,480,420,80)
SetVirtualButtonText(1,"Frame1")
frame=1
Do
Print("Current Frame:"+Str(GetSpriteCurrentFrame(id),0))
If GetVirtualButtonPressed(1) Then SetSpriteFrame(id,frame)
Sync()
If Timer()>15 Then Exit
Loop
End
Help make AGK better by submitting an example for this command! (All examples are subject to approval)