brush - brush handle texture - texture handle frame (optional) - texture frame. Defaults to 0. index (optional) - texture index. Defaults to 0. |
Assigns a texture to a brush. The optional frame parameter specifies which animation frame, if any exist, should be assigned to the brush. The optional index parameter specifies texture layer that the texture should be assigned to. Brushes have up to four texture layers, 0-3 inclusive. |
; dxBrushTexture Example ; -------------------- dxGraphics3D 640,480 dxSetBuffer dxBackBuffer() camera=dxCreateCamera() light=dxCreateLight() dxRotateEntity light,90,0,0 cube=dxCreateCube() dxPositionEntity cube,0,0,5 ; Load texture tex=dxLoadTexture( "media/b3dlogo.jpg" ) ; Create brush brush=dxCreateBrush() ; Apply texture to brush dxBrushTexture brush,tex ; Paint mesh with brush PaintMesh cube,brush While Not dxKeyDown( 1 ) pitch#=0 yaw#=0 roll#=0 If dxKeyDown( 208 )=True Then pitch#=-1 If dxKeyDown( 200 )=True Then pitch#=1 If dxKeyDown( 203 )=True Then yaw#=-1 If dxKeyDown( 205 )=True Then yaw#=1 If dxKeyDown( 45 )=True Then roll#=-1 If dxKeyDown( 44 )=True Then roll#=1 dxTurnEntity cube,pitch#,yaw#,roll# dxRenderWorld dxFlip Wend End |