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

Function LuaMoveAbove

engine/gui/src/gui_script.cpp:3705–3717  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3703 * @param reference [type:node|nil] reference node above which the first node should be moved
3704 */
3705 static int LuaMoveAbove(lua_State* L)
3706 {
3707 HNode hnode;
3708 InternalNode* n = LuaCheckNodeInternal(L, 1, &hnode);
3709 HNode r = INVALID_HANDLE;
3710 if (!lua_isnil(L, 2))
3711 {
3712 r = GetNodeHandle(LuaCheckNodeInternal(L, 2, &hnode));
3713 }
3714 Scene* scene = GuiScriptInstance_Check(L);
3715 MoveNodeAbove(scene, GetNodeHandle(n), r);
3716 return 0;
3717 }
3718
3719 /*# moves the first node below the second
3720 * Alters the ordering of the two supplied nodes by moving the first node

Callers

nothing calls this directly

Calls 4

LuaCheckNodeInternalFunction · 0.85
GuiScriptInstance_CheckFunction · 0.85
GetNodeHandleFunction · 0.70
MoveNodeAboveFunction · 0.70

Tested by

no test coverage detected