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

Method SetAnimationCenter

LuaSTGPlus/LuaWrapper.cpp:1178–1190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1176 return 0;
1177 }
1178 static int SetAnimationCenter(lua_State* L)LNOEXCEPT
1179 {
1180 ResAnimation* p = LRES.FindAnimation(luaL_checkstring(L, 1));
1181 if (!p)
1182 return luaL_error(L, "animation '%s' not found.", luaL_checkstring(L, 1));
1183 for (size_t i = 0; i < p->GetCount(); ++i)
1184 {
1185 p->GetSprite(i)->SetHotSpot(fcyVec2(
1186 static_cast<float>(luaL_checknumber(L, 2) + p->GetSprite(i)->GetTexRect().a.x),
1187 static_cast<float>(luaL_checknumber(L, 3) + p->GetSprite(i)->GetTexRect().a.y)));
1188 }
1189 return 0;
1190 }
1191
1192 // 绘图函数
1193 static int BeginScene(lua_State* L)LNOEXCEPT

Callers

nothing calls this directly

Calls 3

FindAnimationMethod · 0.80
GetCountMethod · 0.80
GetSpriteMethod · 0.45

Tested by

no test coverage detected