diff options
author | chai <chaifix@163.com> | 2018-10-22 21:30:21 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-10-22 21:30:21 +0800 |
commit | 58d09aa3ca4409e2a15473b0ac3c0446f0acb1a2 (patch) | |
tree | 37dadab5575116c75b54064556b045ba8a245871 /src/lua/modules/graphics/graphics.cpp | |
parent | 99bea1e47c813016d89c9e99296fa66e183d808f (diff) |
*misc
Diffstat (limited to 'src/lua/modules/graphics/graphics.cpp')
-rw-r--r-- | src/lua/modules/graphics/graphics.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
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 { |