; GetEntityBrush Example ; ---------------------- Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,1,-6 light=CreateLight() RotateEntity light,45,45,0 ; The master cube - tint it with the number keys master=CreateCube() PositionEntity master,-1.5,1,0 EntityColor master,255,80,80 ; The copycat cube - Space copies the master's look onto it copycat=CreateCube() PositionEntity copycat,1.5,1,0 While Not KeyDown(1) ; 1/2/3 tint the master cube If KeyHit(2) Then EntityColor master,255,80,80 If KeyHit(3) Then EntityColor master,80,255,80 If KeyHit(4) Then EntityColor master,80,80,255 ; Space: grab the master's brush and paint the copycat with it If KeyHit(57) brush=GetEntityBrush(master) PaintEntity copycat,brush ; GetEntityBrush returns a copy - free it once used FreeBrush brush EndIf TurnEntity master,0,1,0 TurnEntity copycat,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/2/3: tint left cube Space: copy its brush to the right Esc: exit" Text 0,20,"brush=GetEntityBrush(master) then PaintEntity copycat,brush" Flip Wend End