GraphicsTemplates

From TTWiki
Jump to navigationJump to search

This page shall just provide a list of templates for easy use and to avoid re-doing the alignment task

Landscape

Ground tiles

Ground tiles.png Normal terrain has 19 different slopes as in the order in the image above. Shown are the grid lines which are part of each ground tile.

template tmpl_groundsprites(x, y) {
    [   0+x,   y, 64, 31, -31,  0 ]
    [  80+x,   y, 64, 31, -31,  0 ]
    [ 160+x,   y, 64, 23, -31,  0 ]
    [ 240+x,   y, 64, 23, -31,  0 ]

    [ 320+x,   y, 64, 31, -31,  0 ]
    [ 398+x,   y, 64, 31, -31,  0 ]
    [ 478+x,   y, 64, 23, -31,  0 ]
    [ 558+x,   y, 64, 23, -31,  0 ]

    [ 638+x,   y, 64, 39, -31, -8 ]
    [ 718+x,   y, 64, 39, -31, -8 ]
    [ 798+x,   y, 64, 31, -31, -8 ]
    [ 878+x,   y, 64, 31, -31, -8 ]

    [ 958+x,   y, 64, 39, -31, -8 ]
    [1038+x,   y, 64, 39, -31, -8 ]
    [1118+x,   y, 64, 31, -31, -8 ]
    [1196+x,   y, 64, 47, -31,-16 ]

    [1276+x,   y, 64, 15, -31,  0 ]
    [1356+x,   y, 64, 31, -31, -8 ]
    [1436+x,   y, 64, 31, -31, -8 ]
}

There are four additional flat rough tiles. They need to be inserted after the usual 19 rough tiles:

template tmpl_rough(x, y) {
    tmpl_level_ground(    x, y)
    tmpl_level_ground( 80+x, y)
    tmpl_level_ground(160+x, y)
    tmpl_level_ground(240+x, y)
}

template tmpl_additional_rough(x, y) {
	tmpl_rough(1510+x, y)
}

Infrastructure

Roads and (default) tracks share a common layout to ease drawing of level crossings and avoid much copy & paste of the underlaying ground tiles, best done by using a layered graphics file.

Roads

Not all tiles are covered by road. The tiles without road can be safely ignored when only adressing roads. Template roads.png

template tmpl_level_ground(x, y) { [ x, y, 64, 31, -31,  0 ] }
template tmpl_short_slope(x, y)  { [ x, y, 64, 23, -31,  0 ] }
template tmpl_long_slope(x, y)   { [ x, y, 64, 39, -31, -8 ] }

template tmpl_infrastructure_road() {
    /* Level road tiles */
    tmpl_level_ground( 82, 40)
    tmpl_level_ground(162, 40)
    tmpl_level_ground(242, 40)
    tmpl_level_ground(322, 40)
    tmpl_level_ground(402, 40)
    tmpl_level_ground(482, 40)
    tmpl_level_ground(562, 40)
    tmpl_level_ground(642, 40)
    tmpl_level_ground(722, 40)
    tmpl_level_ground(  2, 88)
    tmpl_level_ground( 82, 88)

    /* slopes */
    tmpl_long_slope (  82, 152)
    tmpl_short_slope( 162, 152)
    tmpl_short_slope( 242, 152)
    tmpl_long_slope ( 322, 152)

    /* Half road tiles */
    tmpl_level_ground(402, 152)
    tmpl_level_ground(482, 152)
    tmpl_level_ground(562, 152)
    tmpl_level_ground(642, 152)
}