mirror of
https://github.com/love2d/love.git
synced 2026-08-13 09:00:54 +02:00
Added love.graphics.getDimensions and Image/Canvas/ImageData:getDimensions (issue #566)
This commit is contained in:
@@ -47,6 +47,14 @@ int w_ImageData_getHeight(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_ImageData_getDimensions(lua_State *L)
|
||||
{
|
||||
ImageData *t = luax_checkimagedata(L, 1);
|
||||
lua_pushinteger(L, t->getWidth());
|
||||
lua_pushinteger(L, t->getHeight());
|
||||
return 2;
|
||||
}
|
||||
|
||||
int w_ImageData_getPixel(lua_State *L)
|
||||
{
|
||||
ImageData *t = luax_checkimagedata(L, 1);
|
||||
@@ -188,6 +196,7 @@ static const luaL_Reg functions[] =
|
||||
|
||||
{ "getWidth", w_ImageData_getWidth },
|
||||
{ "getHeight", w_ImageData_getHeight },
|
||||
{ "getDimensions", w_ImageData_getDimensions },
|
||||
{ "getPixel", w_ImageData_getPixel },
|
||||
{ "setPixel", w_ImageData_setPixel },
|
||||
{ "mapPixel", w_ImageData_mapPixel },
|
||||
|
||||
Reference in New Issue
Block a user