LoadAnimTexture.bb 820 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ; LoadAnimTexture Example
  2. ; -----------------------
  3. Graphics3D 640,480
  4. SetBuffer BackBuffer()
  5. camera=CreateCamera()
  6. light=CreateLight()
  7. RotateEntity light,90,0,0
  8. cube=CreateCube()
  9. PositionEntity cube,0,0,5
  10. ; Load anim texture
  11. anim_tex=LoadAnimTexture( "media/boomstrip.bmp",49,64,64,0,39 )
  12. While Not KeyDown( 1 )
  13. ; Cycle through anim frame values. 100 represents delay, 39 represents no. of anim frames
  14. frame=MilliSecs()/100 Mod 39
  15. ; Texture cube with anim texture frame
  16. EntityTexture cube,anim_tex,frame
  17. pitch#=0
  18. yaw#=0
  19. roll#=0
  20. If KeyDown( 208 )=True Then pitch#=-1
  21. If KeyDown( 200 )=True Then pitch#=1
  22. If KeyDown( 203 )=True Then yaw#=-1
  23. If KeyDown( 205 )=True Then yaw#=1
  24. If KeyDown( 45 )=True Then roll#=-1
  25. If KeyDown( 44 )=True Then roll#=1
  26. TurnEntity cube,pitch#,yaw#,roll#
  27. RenderWorld
  28. Flip
  29. Wend
  30. End