; EntityTexture Example ; --------------------- Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() light=CreateLight() RotateEntity light,45,45,0 ; A crate for our game scene crate=CreateCube() PositionEntity crate,0,0,5 tex_logo=LoadTexture("media/b3dlogo.jpg") tex_moss=LoadTexture("media/MossyGround.BMP") ; Apply the logo. The optional arguments are frame (animation frame of the ; texture) and index (texture layer 0-7, used for multitexturing). EntityTexture crate,tex_logo,0,0 tex_name$="tex_logo" While Not KeyDown(1) ; Keys 1/2 choose which texture the crate wears If KeyHit(2) EntityTexture crate,tex_logo,0,0 tex_name="tex_logo" EndIf If KeyHit(3) EntityTexture crate,tex_moss,0,0 tex_name="tex_moss" EndIf TurnEntity crate,0,1,0 ; 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,"1: logo texture 2: moss texture Arrows: camera Esc: exit" Text 0,20,"EntityTexture crate,"+tex_name+",0,0" Flip Wend End