Surface - atom description
General description
- Surface atoms represent graphical representation of each tile.
- Type of Surface on specific tile is determined by set Grid atoms of its four vertices.
- In the image above you can see single Surface in the cyan rhombus and its four Grid in the red rects.
- Left and bottom Grid atoms are of type soil and top and right are of type desert, so the result Surface atom is transition from soil to desert.
Properties description
Name | Type | Default value / Obligatory |
Description |
---|---|---|---|
grid | atom[Grid] | obligatory | Main Grid of this Surface |
masque | masque | obligatory | Surface masque. |
transition_grid | atom[Grid] | null | Transition Grid of this Surface |
transition_type | int | obligatory if transition_grid set |
Transition type between grid and transition_grid |
grass | vec_1D[atom[Grass]] | empty vec | Grass representation atom. |
grass_ending | vec_1D[atom[Grass]] | empty vec | Grass ending representation atom. |
Properties in detail
grid
- Grid atom for which this Surface is representant.
- When all vertices of a tile has this Grid type, then this Surface is used.
- It also serves as on of two transition Grids for transition tiles.
transition_grid
- Second Grid if this Surface serves as transition tile.
transition_type
- Type of transition between grid and transition_grid.
- It's a number which describe which vertices have grid and which have transtion_grid by it's binary format.
- Vertices are counted in clockwise order starting with the top vertex.
- It means that meaningful values here are numbers between 1 and 14.
- For example value 3, in binary 0011 means that top and right vertices must have grid type and bottom and left vertices must have transition_grid.
- As in the image above.
grass
- Addition graphics when the tile is irrigated.
grass_ending
- Addition graphics when the tile is irrigated but at the same time it's on the border of area which do not show grass.
- For example tile under some buildings or grid type which does not allow irrigation.
Example
atom ('surface.soil', { grid = 'grid.soil'; masque = { {"images/surface/soil/soil_a.png"}, {"images/surface/soil/soil_b.png"}, {"images/surface/soil/soil_c.png"}, {"images/surface/soil/soil_d.png"}, }, grass = grass, grass_ending = grass_ending }) atom ('surface.desert.soil.1', { grid = 'grid.desert', transition_grid = 'grid.soil', transition_type = 1, masque = {{"images/surface/desert_soil/desert_soil_1.png"}}, grass = grass, grass_ending = grass_ending })