Category: Landscape
Since engine version: 1.0 OC
DrawMaterialQuad
Description
Draws a four-cornered polygon of the specified material and texture into the landscape.
Syntax
bool DrawMaterialQuad(string szMaterialTexture, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, any szBkgMat);
Parameters
- szMaterialTexture:
- Material-Texture combination for the material to be drawn.
- x1:
- X coordinate of the first corner. Always global.
- y1:
- Y coordinate of the first corner. Always global.
- x2:
- X coordinate of the second corner. Always global.
- y2:
- Y coordinate of the second corner. Always global.
- x3:
- X coordinate of the third corner. Always global.
- y3:
- Y coordinate of the third corner. Always global.
- x4:
- X coordinate of the fourth corner. Always global.
- y4:
- Y coordinate of the fourth corner. Always global.
- szBkgMat:
- One of the symbolic constants
DMQ_Sky
,DMQ_Sub
orDMQ_Bridge
, or a material texture combination. Specifies the background material of the chunk drawn. IfDMQ_Sky
, the material will be drawn with sky background. IfDMQ_Sub
, the material will be drawn with the default underground material as background. IfDMQ_Bridge
, the material will be drawn only over layers of equal or lower density, and the background material remains unchanged. If this is a string, the specified material-texture combination is used as background material. The background material is the material that a pixel is replaced with when it is digged away or blasted free.
Remark
The corners of the polygon should be specified in clockwise order and polygon boundaries should not intersect. For more complex or concave shapes you can make multiple calls to this function.
Example
DrawMaterialQuad("Gold-gold", 0,0, LandscapeWidth()-1,0, LandscapeWidth()-1,LandscapeHeight()-1, 0,LandscapeHeight()-1);
Fills the complete landscape with gold.
See also: InsertMaterial