MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / SetImageCenter

Method SetImageCenter

LuaSTGPlus/LuaWrapper.cpp:1168–1177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1166 return 0;
1167 }
1168 static int SetImageCenter(lua_State* L)LNOEXCEPT
1169 {
1170 ResSprite* p = LRES.FindSprite(luaL_checkstring(L, 1));
1171 if (!p)
1172 return luaL_error(L, "image '%s' not found.", luaL_checkstring(L, 1));
1173 p->GetSprite()->SetHotSpot(fcyVec2(
1174 static_cast<float>(luaL_checknumber(L, 2) + p->GetSprite()->GetTexRect().a.x),
1175 static_cast<float>(luaL_checknumber(L, 3) + p->GetSprite()->GetTexRect().a.y)));
1176 return 0;
1177 }
1178 static int SetAnimationCenter(lua_State* L)LNOEXCEPT
1179 {
1180 ResAnimation* p = LRES.FindAnimation(luaL_checkstring(L, 1));

Callers

nothing calls this directly

Calls 2

FindSpriteMethod · 0.80
GetSpriteMethod · 0.45

Tested by

no test coverage detected