aboutsummaryrefslogtreecommitdiff
path: root/src/lua/modules
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-10-22 21:30:21 +0800
committerchai <chaifix@163.com>2018-10-22 21:30:21 +0800
commit58d09aa3ca4409e2a15473b0ac3c0446f0acb1a2 (patch)
tree37dadab5575116c75b54064556b045ba8a245871 /src/lua/modules
parent99bea1e47c813016d89c9e99296fa66e183d808f (diff)
*misc
Diffstat (limited to 'src/lua/modules')
-rw-r--r--src/lua/modules/graphics/canvas.cpp10
-rw-r--r--src/lua/modules/graphics/graphics.cpp16
-rw-r--r--src/lua/modules/graphics/texture.cpp10
3 files changed, 10 insertions, 26 deletions
diff --git a/src/lua/modules/graphics/canvas.cpp b/src/lua/modules/graphics/canvas.cpp
index b64dc16..e49e209 100644
--- a/src/lua/modules/graphics/canvas.cpp
+++ b/src/lua/modules/graphics/canvas.cpp
@@ -40,15 +40,6 @@ namespace JinEngine
return 2;
}
- static int l_setOrigin(lua_State* L)
- {
- CanvasRef ref = checkCanvas(L);
- int x = luax_checknumber(L, 1);
- int y = luax_checknumber(L, 2);
- ref->setOrigin(x, y);
- return 0;
- }
-
static int l_gc(lua_State* L)
{
Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_CANVAS);
@@ -61,7 +52,6 @@ namespace JinEngine
{ "getWidth", l_getWidth },
{ "getHeight", l_getHeight },
{ "getSize", l_getSize },
- { "setOrigin", l_setOrigin },
{ 0, 0 }
};
diff --git a/src/lua/modules/graphics/graphics.cpp b/src/lua/modules/graphics/graphics.cpp
index 2608051..8b2d7cd 100644
--- a/src/lua/modules/graphics/graphics.cpp
+++ b/src/lua/modules/graphics/graphics.cpp
@@ -272,9 +272,11 @@ namespace JinEngine
float sx = luax_optnumber(L, 4, 1);
float sy = luax_optnumber(L, 5, 1);
float r = luax_optnumber(L, 6, 0);
+ float ox = luax_optnumber(L, 7, 0);
+ float oy = luax_optnumber(L, 8, 0);
Proxy* proxy = (Proxy*)luax_toudata(L, 1);
Ref<Texture>& tex = proxy->getRef<Texture>();
- tex->draw(x, y, sx, sy, r);
+ tex->draw(x, y, sx, sy, r, ox, oy);
}
static void l_draw_canvas(lua_State* L)
@@ -286,9 +288,11 @@ namespace JinEngine
float sx = luax_optnumber(L, 4, 1);
float sy = luax_optnumber(L, 5, 1);
float r = luax_optnumber(L, 6, 0);
+ float ox = luax_optnumber(L, 7, 0);
+ float oy = luax_optnumber(L, 8, 0);
Proxy* proxy = (Proxy*)luax_toudata(L, 1);
Ref<Canvas>& p = proxy->getRef<Canvas>();
- p->draw(x, y, sx, sy, r);
+ p->draw(x, y, sx, sy, r, ox, oy);
}
/* jin.graphics.draw(text, font, x, y) */
@@ -371,20 +375,20 @@ namespace JinEngine
float sx = luax_optnumber(L, 5, 1);
float sy = luax_optnumber(L, 6, 1);
float r = luax_optnumber(L, 7, 0);
- float ax = luax_optnumber(L, 8, 0);
- float ay = luax_optnumber(L, 9, 0);
+ float ox = luax_optnumber(L, 8, 0);
+ float oy = luax_optnumber(L, 9, 0);
if (luax_istype(L, 1, JIN_GRAPHICS_TEXTURE))
{
Proxy* proxy = (Proxy*)luax_toudata(L, 1);
Ref<Texture>& tex = proxy->getRef<Texture>();
- tex->draw(q, x, y, sx, sy, r, ax, ay);
+ tex->draw(q, x, y, sx, sy, r, ox, oy);
}
else if (luax_istype(L, 1, JIN_GRAPHICS_CANVAS))
{
Proxy* proxy = (Proxy*)luax_toudata(L, 1);
Ref<Canvas>& p = proxy->getRef<Canvas>();
- p->draw(q, x, y, sx, sy, r, ax, ay);
+ p->draw(q, x, y, sx, sy, r, ox, oy);
}
else
{
diff --git a/src/lua/modules/graphics/texture.cpp b/src/lua/modules/graphics/texture.cpp
index 15e258c..61bfaee 100644
--- a/src/lua/modules/graphics/texture.cpp
+++ b/src/lua/modules/graphics/texture.cpp
@@ -32,15 +32,6 @@ namespace JinEngine
return 1;
}
- static int l_setOrigin(lua_State* L)
- {
- TextureRef ref = checkTexture(L);
- int x = luax_checknumber(L, 2);
- int y = luax_checknumber(L, 3);
- ref->setOrigin(x, y);
- return 0;
- }
-
static int l_getSize(lua_State* L)
{
TextureRef ref = checkTexture(L);
@@ -61,7 +52,6 @@ namespace JinEngine
{ "getWidth", l_getWidth },
{ "getHeight", l_getHeight },
{ "getSize", l_getSize },
- { "setOrigin", l_setOrigin },
{ 0, 0 }
};