[lua] Add Tile.index getter

This commit is contained in:
David Capello 2023-01-12 09:19:49 -03:00
parent a6c1b2bc88
commit 9c728d2cac

View File

@ -33,6 +33,13 @@ struct Tile {
}
};
int Tile_get_index(lua_State* L)
{
auto tile = get_obj<Tile>(L, 1);
lua_pushinteger(L, tile->ti);
return 1;
}
int Tile_get_image(lua_State* L)
{
auto tile = get_obj<Tile>(L, 1);
@ -165,6 +172,7 @@ const luaL_Reg Tile_methods[] = {
};
const Property Tile_properties[] = {
{ "index", Tile_get_index, nullptr },
{ "image", Tile_get_image, nullptr }, // TODO Tile_set_image
{ "data", Tile_get_data, Tile_set_data },
{ "color", Tile_get_color, Tile_set_color },