- input nml:
- spriteset(stationset1, "src/gfx/cc_grid.png") { tmpl_groundsprites(1, 1) }
- spritegroup spritegroup1 { // alternatively: reference spriteset directly in spritelayout, and generate a spritegroup automatically using the same spriteset for all cases
- little: [ ];
- lots: [ stationset1 ];
- }
- spriteset(stationset2, "src/gfx/cc_build.png") { tmpl_buildingsprites(1, 1) }
- spriteset(stationset3, "src/gfx/cc_build.png") { tmpl_buildingsprites(1, 2) }
- spriteset(stationset4, "src/gfx/cc_build.png") { tmpl_buildingsprites(1, 3) }
- spritegroup spritegroup2 {
- little: [ stationset2 ];
- lots: [ stationset3, stationset4 ];
- }
- spritelayout stationlayout2 {
- ground {
- sprite: spritegroup1(0, 0) // the second offset must be a compile-time constant, and is added to the first for Y direction. in this case use sprite 0 for both orientations
- }
- building {
- sprite: spritegroup2(0, 1) // use sprite 0 for X and 0+1 for Y
- }
- }
- switch (FEAT_STATION, SELF, switch3, [ ... ] {
- ...
- stationlayout2;
- }
- item(FEAT_STATION, station4) {
- property {
- ... nothing about layouts here ...
- }
- graphics {
- switch3;
- }
- }
- output grf:
- action0:
- layout0: stationlayout2 using var10=0 for ground, var10=1 for building1
- layout1: stationlayout2 using var10=0 for ground, var10=1 for building1 and an additional 1 offset in the building for the Y orientation
- action3
- -> varactions according to switch3
- -> varaction(var0C)
- 14: return layout0
- default:
- -> varaction(var10)
- 0: return stationgroup1
- 1: return stationgroup2