mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-01 18:00:26 +00:00
[lua] Add Sprite.id and Layer.id properties
This commit is contained in:
parent
1ce3e8e392
commit
8aa49479b8
@ -49,6 +49,13 @@ int Layer_cel(lua_State* L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int Layer_get_id(lua_State* L)
|
||||
{
|
||||
auto layer = get_docobj<Layer>(L, 1);
|
||||
lua_pushinteger(L, layer->id());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int Layer_get_sprite(lua_State* L)
|
||||
{
|
||||
auto layer = get_docobj<Layer>(L, 1);
|
||||
@ -383,6 +390,7 @@ const luaL_Reg Layer_methods[] = {
|
||||
};
|
||||
|
||||
const Property Layer_properties[] = {
|
||||
{ "id", Layer_get_id, nullptr },
|
||||
{ "sprite", Layer_get_sprite, nullptr },
|
||||
{ "parent", Layer_get_parent, Layer_set_parent },
|
||||
{ "layers", Layer_get_layers, nullptr },
|
||||
|
@ -610,6 +610,13 @@ int Sprite_get_events(lua_State* L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int Sprite_get_id(lua_State* L)
|
||||
{
|
||||
auto sprite = get_docobj<Sprite>(L, 1);
|
||||
lua_pushinteger(L, sprite->id());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int Sprite_get_filename(lua_State* L)
|
||||
{
|
||||
auto sprite = get_docobj<Sprite>(L, 1);
|
||||
@ -861,6 +868,7 @@ const luaL_Reg Sprite_methods[] = {
|
||||
};
|
||||
|
||||
const Property Sprite_properties[] = {
|
||||
{ "id", Sprite_get_id, nullptr },
|
||||
{ "filename", Sprite_get_filename, Sprite_set_filename },
|
||||
{ "isModified", Sprite_get_isModified, nullptr },
|
||||
{ "width", Sprite_get_width, Sprite_set_width },
|
||||
|
Loading…
Reference in New Issue
Block a user