1
0
Fork 0
mirror of https://github.com/ctruLua/ctruLua.git synced 2025-10-27 16:39:29 +00:00

Added a sprite library (unfinished, but working)

This commit is contained in:
Firew0lf 2015-09-01 11:31:09 +02:00
parent 6a26be4b43
commit a4a6e09d74
2 changed files with 82 additions and 0 deletions

View file

@ -81,6 +81,15 @@ static int texture_drawPart(lua_State *L) {
return 0;
}
static int texture_getSize(lua_State *L) {
texture_userdata *texture = luaL_checkudata(L, 1, "LTexture");
lua_pushinteger(L, texture->texture->width);
lua_pushinteger(L, texture->texture->height);
return 2;
}
static int texture_unload(lua_State *L) {
texture_userdata *texture = luaL_checkudata(L, 1, "LTexture");
@ -138,6 +147,7 @@ static const struct luaL_Reg texture_methods[] = {
{ "draw", texture_draw },
{ "drawPart", texture_drawPart },
{ "scale", texture_scale },
{ "getSize", texture_getSize },
{ "unload", texture_unload },
{ "getPixel", texture_getPixel },
{ "setPixel", texture_setPixel },