LoadAnimTexture.htm 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>LoadAnimTexture ( file$,flags,frame_width,frame_height,first_frame,frame_count )</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. file$ - name of image file with animation frames laid out in left-right, top-to-bottom order <br />
  13. <br />
  14. flags (optional) - texture flag: <br />
  15. 1: Color (default) <br />
  16. 2: Alpha <br />
  17. 4: Masked <br />
  18. 8: Mipmapped <br />
  19. 16: Clamp U <br />
  20. 32: Clamp V <br />
  21. 64: Spherical reflection map <br />
  22. 128: Cubic environment map <br />
  23. 256: Store texture in vram <br />
  24. 512: Force the use of high color textures <br />
  25. <br />
  26. frame_width - width of each animation frame <br />
  27. frame_height - height of each animation frame <br />
  28. first_frame - the first frame to be used as an animation frame <br />
  29. frame_count - the amount of frames to be used
  30. </td>
  31. </tr>
  32. </table>
  33. <h1>Description</h1>
  34. <table>
  35. <tr>
  36. <td>
  37. Loads an animated texture from an image file and returns the texture's handle. <br />
  38. <br />
  39. The flags parameter allows you to apply certain effects to the texture. Flags can be added to combine two or more effects, e.g. 3 (1+2) = texture with colour and alpha maps. <br />
  40. <br />
  41. See <a class=small href=../3d_commands/CreateTexture.htm>CreateTexture</a> for more detailed descriptions of the texture flags. <br />
  42. <br />
  43. The frame_width, frame_height, first_frame and frame_count parameters determine how Blitz will separate the image file into individual animation frames.
  44. <br>
  45. <br>
  46. See also: <a class=small href=CreateTexture.htm>CreateTexture</a>, <a class=small href=LoadTexture.htm>LoadTexture</a>.
  47. </td>
  48. </tr>
  49. </table>
  50. <h1><a href=../3d_examples/LoadAnimTexture.bb>Example</a></h1>
  51. <table>
  52. <tr>
  53. <td>
  54. ; LoadAnimTexture Example <br />
  55. ; ----------------------- <br />
  56. <br />
  57. Graphics3D 640,480 <br />
  58. SetBuffer BackBuffer() <br />
  59. <br />
  60. camera=CreateCamera() <br />
  61. <br />
  62. light=CreateLight() <br />
  63. RotateEntity light,90,0,0 <br />
  64. <br />
  65. cube=CreateCube() <br />
  66. PositionEntity cube,0,0,5 <br />
  67. <br />
  68. ; Load anim texture <br />
  69. anim_tex=LoadAnimTexture( "media/boomstrip.bmp",49,64,64,0,39 ) <br />
  70. <br />
  71. While Not KeyDown( 1 ) <br />
  72. <br />
  73. ; Cycle through anim frame values. 100 represents delay, 39 represents no. of anim frames <br />
  74. frame=MilliSecs()/100 Mod 39 <br />
  75. <br />
  76. ; Texture cube with anim texture frame <br />
  77. EntityTexture cube,anim_tex,frame <br />
  78. <br />
  79. pitch#=0 <br />
  80. yaw#=0 <br />
  81. roll#=0 <br />
  82. <br />
  83. If KeyDown( 208 )=True Then pitch#=-1 <br />
  84. If KeyDown( 200 )=True Then pitch#=1 <br />
  85. If KeyDown( 203 )=True Then yaw#=-1 <br />
  86. If KeyDown( 205 )=True Then yaw#=1 <br />
  87. If KeyDown( 45 )=True Then roll#=-1 <br />
  88. If KeyDown( 44 )=True Then roll#=1 <br />
  89. <br />
  90. TurnEntity cube,pitch#,yaw#,roll# <br />
  91. <br />
  92. RenderWorld <br />
  93. Flip <br />
  94. <br />
  95. Wend <br />
  96. <br />
  97. End
  98. </td>
  99. </tr>
  100. </table>
  101. <br>
  102. <a target=_top href=../index.htm>Index</a><br>
  103. <br>
  104. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=LoadAnimTexture&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  105. </html>