MCPcopy Create free account
hub / github.com/defold/defold / LuaSetSlice9

Function LuaSetSlice9

engine/gui/src/gui_script.cpp:3105–3127  ·  view source on GitHub ↗

set the slice9 configuration for the node * Set the slice9 configuration values for the node. * * @name gui.set_slice9 * @param node [type:node] node to manipulate * @param values [type:vector4] new values */

Source from the content-addressed store, hash-verified

3103 * @param values [type:vector4] new values
3104 */
3105 static int LuaSetSlice9(lua_State* L)
3106 {
3107 int top = lua_gettop(L);
3108 (void) top;
3109
3110 HNode hnode;
3111 InternalNode* n = LuaCheckNodeInternal(L, 1, &hnode);
3112 (void) n;
3113
3114 Vector4* v4;
3115 if ((v4 = dmScript::ToVector4(L, 2)))
3116 {
3117 Scene* scene = GuiScriptInstance_Check(L);
3118 dmGui::SetNodeProperty(scene, hnode, dmGui::PROPERTY_SLICE9, *v4);
3119 }
3120 else
3121 {
3122 luaL_error(L, "invalid parameter given");
3123 }
3124
3125 assert(top == lua_gettop(L));
3126 return 0;
3127 }
3128
3129 /*# get the slice9 values for the node
3130 * Returns the slice9 configuration values for the node.

Callers

nothing calls this directly

Calls 7

lua_gettopFunction · 0.85
LuaCheckNodeInternalFunction · 0.85
ToVector4Function · 0.85
GuiScriptInstance_CheckFunction · 0.85
luaL_errorFunction · 0.85
SetNodePropertyFunction · 0.70
assertFunction · 0.50

Tested by

no test coverage detected