; RotateImage Example ; ------------------- Graphics 640,480,0,2 SetBuffer BackBuffer() ; Crisp rotation keeps the mask colour clean (try 1 for filtered edges) TFormFilter 0 ; RotateImage is too slow to call every frame, so we pre-rotate ; 36 copies of the ship BEFORE the loop and page through them player=LoadImage("media/player.bmp") Dim spin(35) For i=0 To 35 spin(i)=CopyImage(player) RotateImage spin(i),i*10 ; each copy turned 10 degrees further MidHandle spin(i) ; draw each rotated copy from its centre Next frame=0 delay_ms=40 timer=MilliSecs() While Not KeyDown(1) Cls ; [ / ] change the spin speed If KeyHit(26) And delay_ms<200 Then delay_ms=delay_ms+20 If KeyHit(27) And delay_ms>20 Then delay_ms=delay_ms-20 ; Step to the next pre-rotated copy If MilliSecs()>timer+delay_ms Then timer=MilliSecs() frame=(frame+1) Mod 36 End If DrawImage spin(frame),320,240 Text 0,0,"[ / ] : spin speed Esc: exit" Text 0,20,"Pre-rotated with RotateImage - showing the "+(frame*10)+" degree copy" Flip Wend End