Terrain Engine 2D  1.10
A 2D Block Engine
TerrainEngine2D.BlockInfo Class Reference

Information of each block type More...

Public Member Functions

void SetupBlockInfo (int textureMapWidth, int textureMapHeight, int pixelsPerBlock)
 Sets up the texture positioning and tile units for mesh building More...
 

Properties

string Name [get]
 Name of the block type More...
 
float TexturePositionX [get]
 X position of the block's texture in the texture map (in block units) More...
 
float TexturePositionY [get]
 Y position of the block's texture in the texture map (in block units) More...
 
int TextureWidth [get]
 Width of the block's texture (in block units) More...
 
int TextureHeight [get]
 Height of the block's texture (in block units) More...
 
float TileUnitX [get]
 Ratio of block's width to that of the entire texture (for UV mapping) More...
 
float TileUnitY [get]
 Ratio of block's height to that of the entire texture (for UV mapping) More...
 
bool MultiBlock [get]
 Whether block has a multi-tile texture More...
 
bool OverlapBlock [get]
 Whether block is an Overlap block More...
 
int NumVariations [get]
 The number of different block variations (default is 1) More...
 
bool Transparent [get]
 Whether the block has transparent pixels (this does not include the edges/corners of Overlap Blocks) Used for optimizing mesh generation More...
 
bool FallingBlock [get]
 Whether this block falls with gravity (if there is no block underneith it of the same layer it will fall down) More...
 

Detailed Description

Information of each block type

Member Function Documentation

◆ SetupBlockInfo()

void TerrainEngine2D.BlockInfo.SetupBlockInfo ( int  textureMapWidth,
int  textureMapHeight,
int  pixelsPerBlock 
)

Sets up the texture positioning and tile units for mesh building

Parameters
textureMapWidthThe width of the texture map containing the block (in pixels)
textureMapHeightThe height of the texture map containing the block (in pixels)
pixelsPerBlockThe number of pixels per block ratio

Property Documentation

◆ FallingBlock

bool TerrainEngine2D.BlockInfo.FallingBlock
get

Whether this block falls with gravity (if there is no block underneith it of the same layer it will fall down)

◆ MultiBlock

bool TerrainEngine2D.BlockInfo.MultiBlock
get

Whether block has a multi-tile texture

◆ Name

string TerrainEngine2D.BlockInfo.Name
get

Name of the block type

◆ NumVariations

int TerrainEngine2D.BlockInfo.NumVariations
get

The number of different block variations (default is 1)

◆ OverlapBlock

bool TerrainEngine2D.BlockInfo.OverlapBlock
get

Whether block is an Overlap block

◆ TextureHeight

int TerrainEngine2D.BlockInfo.TextureHeight
get

Height of the block's texture (in block units)

◆ TexturePositionX

float TerrainEngine2D.BlockInfo.TexturePositionX
get

X position of the block's texture in the texture map (in block units)

◆ TexturePositionY

float TerrainEngine2D.BlockInfo.TexturePositionY
get

Y position of the block's texture in the texture map (in block units)

◆ TextureWidth

int TerrainEngine2D.BlockInfo.TextureWidth
get

Width of the block's texture (in block units)

◆ TileUnitX

float TerrainEngine2D.BlockInfo.TileUnitX
get

Ratio of block's width to that of the entire texture (for UV mapping)

◆ TileUnitY

float TerrainEngine2D.BlockInfo.TileUnitY
get

Ratio of block's height to that of the entire texture (for UV mapping)

◆ Transparent

bool TerrainEngine2D.BlockInfo.Transparent
get

Whether the block has transparent pixels (this does not include the edges/corners of Overlap Blocks) Used for optimizing mesh generation


The documentation for this class was generated from the following file: