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

Function LuaMoveBelow

engine/gui/src/gui_script.cpp:3728–3740  ·  view source on GitHub ↗

moves the first node below the second * Alters the ordering of the two supplied nodes by moving the first node * below the second. * If the second argument is `nil` the first node is moved to the bottom. * * @name gui.move_below * @param node [type:node] to move * @param reference [type:node|nil] reference node below which the first node should be moved */

Source from the content-addressed store, hash-verified

3726 * @param reference [type:node|nil] reference node below which the first node should be moved
3727 */
3728 static int LuaMoveBelow(lua_State* L)
3729 {
3730 HNode hnode;
3731 InternalNode* n = LuaCheckNodeInternal(L, 1, &hnode);
3732 HNode r = INVALID_HANDLE;
3733 if (!lua_isnil(L, 2))
3734 {
3735 r = GetNodeHandle(LuaCheckNodeInternal(L, 2, &hnode));
3736 }
3737 Scene* scene = GuiScriptInstance_Check(L);
3738 MoveNodeBelow(scene, GetNodeHandle(n), r);
3739 return 0;
3740 }
3741
3742 /*# gets the parent of the specified node
3743 * Returns the parent node of the specified node.

Callers

nothing calls this directly

Calls 4

LuaCheckNodeInternalFunction · 0.85
GuiScriptInstance_CheckFunction · 0.85
GetNodeHandleFunction · 0.70
MoveNodeBelowFunction · 0.70

Tested by

no test coverage detected