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

Method SetImageState

LuaSTGPlus/LuaWrapper.cpp:1107–1127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1105 return 0;
1106 }
1107 static int SetImageState(lua_State* L)LNOEXCEPT
1108 {
1109 ResSprite* p = LRES.FindSprite(luaL_checkstring(L, 1));
1110 if (!p)
1111 return luaL_error(L, "image '%s' not found.", luaL_checkstring(L, 1));
1112
1113 p->SetBlendMode(TranslateBlendMode(L, 2));
1114 if (lua_gettop(L) == 3)
1115 p->GetSprite()->SetColor(*static_cast<fcyColor*>(luaL_checkudata(L, 3, TYPENAME_COLOR)));
1116 else if (lua_gettop(L) == 6)
1117 {
1118 fcyColor tColors[] = {
1119 *static_cast<fcyColor*>(luaL_checkudata(L, 3, TYPENAME_COLOR)),
1120 *static_cast<fcyColor*>(luaL_checkudata(L, 4, TYPENAME_COLOR)),
1121 *static_cast<fcyColor*>(luaL_checkudata(L, 5, TYPENAME_COLOR)),
1122 *static_cast<fcyColor*>(luaL_checkudata(L, 6, TYPENAME_COLOR))
1123 };
1124 p->GetSprite()->SetColor(tColors);
1125 }
1126 return 0;
1127 }
1128 static int SetFontState(lua_State* L)LNOEXCEPT
1129 {
1130 ResFont* p = LRES.FindSpriteFont(luaL_checkstring(L, 1));

Callers

nothing calls this directly

Calls 4

TranslateBlendModeFunction · 0.85
FindSpriteMethod · 0.80
SetBlendModeMethod · 0.45
GetSpriteMethod · 0.45

Tested by

no test coverage detected