Difference between revisions of "NML:List of tile slopes"
(add nav template) |
(added slope sprites to slope constant table) |
||
Line 28: | Line 28: | ||
{| class="t" |
{| class="t" |
||
+ | ! Sprite |
||
! Named constant |
! Named constant |
||
! Equivalent bitmask |
! Equivalent bitmask |
||
Line 33: | Line 34: | ||
! Sprite offset |
! Sprite offset |
||
|- |
|- |
||
+ | | [[Image:Sprite3981.png]] |
||
| SLOPE_FLAT |
| SLOPE_FLAT |
||
| <code style="color:darkgreen">bitmask()</code> |
| <code style="color:darkgreen">bitmask()</code> |
||
Line 38: | Line 40: | ||
| 0 |
| 0 |
||
|- |
|- |
||
+ | | [[Image:Sprite3982.png]] |
||
| SLOPE_W |
| SLOPE_W |
||
| <code style="color:darkgreen">bitmask(CORNER_W)</code> |
| <code style="color:darkgreen">bitmask(CORNER_W)</code> |
||
Line 43: | Line 46: | ||
| 1 |
| 1 |
||
|- |
|- |
||
+ | | [[Image:Sprite3983.png]] |
||
| SLOPE_S |
| SLOPE_S |
||
| <code style="color:darkgreen">bitmask(CORNER_S)</code> |
| <code style="color:darkgreen">bitmask(CORNER_S)</code> |
||
Line 48: | Line 52: | ||
| 2 |
| 2 |
||
|- |
|- |
||
+ | | [[Image:Sprite3985.png]] |
||
| SLOPE_E |
| SLOPE_E |
||
| <code style="color:darkgreen">bitmask(CORNER_E)</code> |
| <code style="color:darkgreen">bitmask(CORNER_E)</code> |
||
Line 53: | Line 58: | ||
| 4 |
| 4 |
||
|- |
|- |
||
+ | | [[Image:Sprite3989.png]] |
||
| SLOPE_N |
| SLOPE_N |
||
| <code style="color:darkgreen">bitmask(CORNER_N)</code> |
| <code style="color:darkgreen">bitmask(CORNER_N)</code> |
||
Line 58: | Line 64: | ||
| 8 |
| 8 |
||
|- |
|- |
||
+ | | [[Image:Sprite3990.png]] |
||
| SLOPE_NW |
| SLOPE_NW |
||
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_W)</code> |
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_W)</code> |
||
Line 63: | Line 70: | ||
| 9 |
| 9 |
||
|- |
|- |
||
+ | | [[Image:Sprite3984.png]] |
||
| SLOPE_SW |
| SLOPE_SW |
||
| <code style="color:darkgreen">bitmask(CORNER_S, CORNER_W)</code> |
| <code style="color:darkgreen">bitmask(CORNER_S, CORNER_W)</code> |
||
Line 68: | Line 76: | ||
| 3 |
| 3 |
||
|- |
|- |
||
+ | | [[Image:Sprite3987.png]] |
||
| SLOPE_SE |
| SLOPE_SE |
||
| <code style="color:darkgreen">bitmask(CORNER_S, CORNER_E)</code> |
| <code style="color:darkgreen">bitmask(CORNER_S, CORNER_E)</code> |
||
Line 73: | Line 82: | ||
| 6 |
| 6 |
||
|- |
|- |
||
+ | | [[Image:Sprite3993.png]] |
||
| SLOPE_NE |
| SLOPE_NE |
||
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_E)</code> |
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_E)</code> |
||
Line 78: | Line 88: | ||
| 12 |
| 12 |
||
|- |
|- |
||
+ | | [[Image:Sprite3986.png]] |
||
| SLOPE_EW |
| SLOPE_EW |
||
| <code style="color:darkgreen">bitmask(CORNER_E, CORNER_W)</code> |
| <code style="color:darkgreen">bitmask(CORNER_E, CORNER_W)</code> |
||
Line 83: | Line 94: | ||
| 5 |
| 5 |
||
|- |
|- |
||
+ | | [[Image:Sprite3991.png]] |
||
| SLOPE_NS |
| SLOPE_NS |
||
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_S)</code> |
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_S)</code> |
||
Line 88: | Line 100: | ||
| 10 |
| 10 |
||
|- |
|- |
||
+ | | [[Image:Sprite3992.png]] |
||
| SLOPE_NWS |
| SLOPE_NWS |
||
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_W, CORNER_S)</code> |
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_W, CORNER_S)</code> |
||
Line 93: | Line 106: | ||
| 11 |
| 11 |
||
|- |
|- |
||
+ | | [[Image:Sprite3988.png]] |
||
| SLOPE_WSE |
| SLOPE_WSE |
||
| <code style="color:darkgreen">bitmask(CORNER_W, CORNER_S, CORNER_E)</code> |
| <code style="color:darkgreen">bitmask(CORNER_W, CORNER_S, CORNER_E)</code> |
||
Line 98: | Line 112: | ||
| 7 |
| 7 |
||
|- |
|- |
||
+ | | [[Image:Sprite3995.png]] |
||
| SLOPE_SEN |
| SLOPE_SEN |
||
| <code style="color:darkgreen">bitmask(CORNER_S, CORNER_E, CORNER_N)</code> |
| <code style="color:darkgreen">bitmask(CORNER_S, CORNER_E, CORNER_N)</code> |
||
Line 103: | Line 118: | ||
| 14 |
| 14 |
||
|- |
|- |
||
+ | | [[Image:Sprite3994.png]] |
||
| SLOPE_ENW |
| SLOPE_ENW |
||
| <code style="color:darkgreen">bitmask(CORNER_E, CORNER_N, CORNER_W)</code> |
| <code style="color:darkgreen">bitmask(CORNER_E, CORNER_N, CORNER_W)</code> |
||
Line 108: | Line 124: | ||
| 13 |
| 13 |
||
|- |
|- |
||
+ | | [[Image:Sprite3998.png]] |
||
| SLOPE_STEEP_W |
| SLOPE_STEEP_W |
||
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_W, CORNER_S, IS_STEEP_SLOPE)</code> |
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_W, CORNER_S, IS_STEEP_SLOPE)</code> |
||
Line 113: | Line 130: | ||
| 17 |
| 17 |
||
|- |
|- |
||
+ | | [[Image:Sprite3997.png]] |
||
| SLOPE_STEEP_S |
| SLOPE_STEEP_S |
||
| <code style="color:darkgreen">bitmask(CORNER_W, CORNER_S, CORNER_E, IS_STEEP_SLOPE)</code> |
| <code style="color:darkgreen">bitmask(CORNER_W, CORNER_S, CORNER_E, IS_STEEP_SLOPE)</code> |
||
Line 118: | Line 136: | ||
| 16 |
| 16 |
||
|- |
|- |
||
+ | | [[Image:Sprite3999.png]] |
||
| SLOPE_STEEP_E |
| SLOPE_STEEP_E |
||
| <code style="color:darkgreen">bitmask(CORNER_S, CORNER_E, CORNER_N, IS_STEEP_SLOPE)</code> |
| <code style="color:darkgreen">bitmask(CORNER_S, CORNER_E, CORNER_N, IS_STEEP_SLOPE)</code> |
||
Line 123: | Line 142: | ||
| 18 |
| 18 |
||
|- |
|- |
||
+ | | [[Image:Sprite3996.png]] |
||
| SLOPE_STEEP_N |
| SLOPE_STEEP_N |
||
| <code style="color:darkgreen">bitmask(CORNER_E, CORNER_N, CORNER_W, IS_STEEP_SLOPE)</code> |
| <code style="color:darkgreen">bitmask(CORNER_E, CORNER_N, CORNER_W, IS_STEEP_SLOPE)</code> |
Revision as of 13:58, 6 September 2011
Vehicles, Stations, Canals, Bridges, Towns, Houses, Industries (Tiles), Cargos, Airports+Tiles, Objects, Railtypes, Roadtypes, Tramtypes, Terrain
Tiles in TTD can have various slopes. The slope is a bitmask that may contain the following bits:
bit flag | meaning |
---|---|
CORNER_W | west corner is above the lowest corner. |
CORNER_S | south corner is above the lowest corner. |
CORNER_E | east corner is above the lowest corner. |
CORNER_N | north corner is above the lowest corner. |
IS_STEEP_SLOPE | this tile is a steep slope (the corner opposite to the lowest corner is 2 units higher). |
The resulting, possible values of this bitmask are given in the following table. The image below that illustrates them graphically. See also the builtin function num_corners_raised(slope)
.
Sprites for slopes are always in the same order in TTD. For example, GROUND_SPRITE_NORMAL
is the sprite number of a flat grass tile. It is followed by 18 other sprites, that display a flat grass tile for each possible slope. The order of these sprites is given in the last column of the table. The builtin function slope_to_sprite_offset(slope)
can be used to determine the sprite offset of a given slope.