; LoadAnimTexture Example ; ----------------------- Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() ; A billboard sprite to play the explosion on (sprites always face the camera) boom=CreateSprite() ScaleSprite boom,1.25,1 PositionEntity boom,0,0,5 ; Full-bright, so the explosion is not darkened by scene lighting EntityFX boom,1 ; Load a 6-frame explosion strip: each frame is 60x48 pixels. ; Flag 4 = masked, so the black background becomes transparent. boom_tex=LoadAnimTexture("media/kaboom.bmp",4,60,48,0,6) While Not KeyDown(1) ; Advance one animation frame every 100 milliseconds, looping 0-5 frame=(MilliSecs()/100) Mod 6 ; Apply the current frame of the anim texture to the sprite EntityTexture boom,boom_tex,frame ; Arrow keys move the camera If KeyDown(200) Then MoveEntity camera,0,0,0.1 If KeyDown(208) Then MoveEntity camera,0,0,-0.1 If KeyDown(203) Then TurnEntity camera,0,1,0 If KeyDown(205) Then TurnEntity camera,0,-1,0 RenderWorld Text 0,0,"Arrows: camera Esc: exit" Text 0,20,"EntityTexture boom,boom_tex,"+frame+" (frame "+frame+" of 0-5)" Flip Wend End