Code: Select all
class Mapper implements GL_Program
{
properties:
mapper = null;
virtual Start()
{
_mapper = NewMapper("map");
mapper = _mapper;
_ts = _mapper.AddTileSet("tiles.tga", 16, 16);
_layer = _mapper.AddLayer(100, 100);
for(j=0; j<100; j++)
{
for (i=0; i<100; i++)
{
_layer.Set(i, j, _ts, Rand(0,31));
}
}
_pad = NewPad("pad");
_pad.SetPreset("CURSORS");
_controller = NewController("contr");
_controller.SetPad(_pad);
_controller.SetUpdateCallback(this, "OnController");
}
function OnController(_controller)
{
mapper.SetOffset(_controller.GetX(), _controller.GetY());
}
}
Requiere build >= 20440