Files
BlitzNext/_release/help/commands/3d_commands/LoadAnimTexture.htm
T
2014-12-08 12:43:20 +13:00

106 lines
3.1 KiB
HTML

<html>
<head>
<title>Blitz3D Docs</title>
<link rel=stylesheet href=../css/commands.css type=text/css>
</head>
<body>
<h1>LoadAnimTexture ( file$,flags,frame_width,frame_height,first_frame,frame_count )</h1>
<h1>Parameters</h1>
<table>
<tr>
<td>
file$ - name of image file with animation frames laid out in left-right, top-to-bottom order
<br />
<br />
flags (optional) - texture flag:
<br />
1: Color (default)
<br />
2: Alpha
<br />
4: Masked
<br />
8: Mipmapped
<br />
16: Clamp U
<br />
32: Clamp V
<br />
64: Spherical reflection map
<br />
128: Cubic environment map
<br />
256: Store texture in vram
<br />
512: Force the use of high color textures
<br />
<br />
frame_width - width of each animation frame
<br />
frame_height - height of each animation frame
<br />
first_frame - the first frame to be used as an animation frame
<br />
frame_count - the amount of frames to be used
</td>
</tr>
</table>
<h1>Description</h1>
<table>
<tr>
<td>
Loads an animated texture from an image file and returns the texture's handle.
<br />
<br />
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 />
<br />
See <a class=small href=../3d_commands/CreateTexture.htm>CreateTexture</a> for more detailed descriptions of the texture flags.
<br />
<br />
The frame_width, frame_height, first_frame and frame_count parameters determine how Blitz will separate the image file into individual animation frames.
<br>
<br>
See also: <a class=small href=CreateTexture.htm>CreateTexture</a>, <a class=small href=LoadTexture.htm>LoadTexture</a>.
</td>
</tr>
</table>
<h1><a href=../3d_examples/LoadAnimTexture.bb>Example</a></h1>
<table>
<tr>
<td>
; LoadAnimTexture Example
<br />
; -----------------------
<br />
<br />
Graphics3D 640,480
<br />
SetBuffer BackBuffer()
<br />
<br />
camera=CreateCamera()
<br />
<br />
light=CreateLight()
<br />
RotateEntity light,90,0,0
<br />
<br />
cube=CreateCube()
<br />
PositionEntity cube,0,0,5
<br />
<br />
; Load anim texture
<br />
anim_tex=LoadAnimTexture( "media/boomstrip.bmp",49,64,64,0,39 )
<br />
<br />
While Not KeyDown( 1 )
<br />
<br />
; Cycle through anim frame values. 100 represents delay, 39 represents no. of anim frames
<br />
frame=MilliSecs()/100 Mod 39
<br />
<br />
; Texture cube with anim texture frame
<br />
EntityTexture cube,anim_tex,frame
<br />
<br />
pitch#=0
<br />
yaw#=0
<br />
roll#=0
<br />
<br />
If KeyDown( 208 )=True Then pitch#=-1
<br />
If KeyDown( 200 )=True Then pitch#=1
<br />
If KeyDown( 203 )=True Then yaw#=-1
<br />
If KeyDown( 205 )=True Then yaw#=1
<br />
If KeyDown( 45 )=True Then roll#=-1
<br />
If KeyDown( 44 )=True Then roll#=1
<br />
<br />
TurnEntity cube,pitch#,yaw#,roll#
<br />
<br />
RenderWorld
<br />
Flip
<br />
<br />
Wend
<br />
<br />
End
</td>
</tr>
</table>
<br>
<a target=_top href=../index.htm>Index</a><br>
<br>
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>
</html>