mirror of
https://github.com/love2d/love.git
synced 2026-08-19 04:06:17 +02:00
Renamed arguments in setTransform method. Merge setters in to one lamba
--HG-- branch : bodygettransform
This commit is contained in:
@@ -269,11 +269,13 @@ int w_Body_setY(lua_State *L)
|
|||||||
int w_Body_setTransform(lua_State *L)
|
int w_Body_setTransform(lua_State *L)
|
||||||
{
|
{
|
||||||
Body *t = luax_checkbody(L, 1);
|
Body *t = luax_checkbody(L, 1);
|
||||||
float arg1 = (float)luaL_checknumber(L, 2);
|
float x = (float)luaL_checknumber(L, 2);
|
||||||
float arg2 = (float)luaL_checknumber(L, 3);
|
float y = (float)luaL_checknumber(L, 3);
|
||||||
float arg3 = (float)luaL_checknumber(L, 4);
|
float angle = (float)luaL_checknumber(L, 4);
|
||||||
luax_catchexcept(L, [&](){ t->setPosition(arg1, arg2); });
|
luax_catchexcept(L, [&](){
|
||||||
luax_catchexcept(L, [&](){ t->setAngle(arg3); });
|
t->setPosition(x, y);
|
||||||
|
t->setAngle(angle);
|
||||||
|
});
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user