EntityTexture entity,texture[,frame][,index]  

Parameters:

entity - entity handle
texture - texture handle
frame (optional) - frame of texture
index (optional) - index of layer to be textured.

Description:

Sets the texture of an entity.

The optional frame parameter specifies which texture animation frame, if any exist, should be used as the texture. Defaults to 0.

The optional index parameter specifies which texture layer the texture should use. There are four available texture layers, 0-3 inclusive. Defaults to 0.

Example:

; EntityTexture Example
; ---------------------

Graphics3D 640,480
SetBuffer BackBuffer()

camera=CreateCamera()

light=CreateLight()
RotateEntity light,90,0,0

cube=CreateCube()
PositionEntity cube,0,0,5

; Load texture
tex=LoadTexture( "media/b3dlogo.jpg" )

; Texture entity
EntityTexture cube,tex

While Not KeyDown( 1 )

pitch#=0
yaw#=0
roll#=0

If KeyDown( 208 )=True Then pitch#=-1
If KeyDown( 200 )=True Then pitch#=1
If KeyDown( 203 )=True Then yaw#=-1
If KeyDown( 205 )=True Then yaw#=1
If KeyDown( 45 )=True Then roll#=-1
If KeyDown( 44 )=True Then roll#=1

TurnEntity cube,pitch#,yaw#,roll#

RenderWorld
Flip

Wend

End

Index