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

Function LuaDeleteNode

engine/gui/src/gui_script.cpp:1063–1078  ·  view source on GitHub ↗

deletes a node * * Deletes the specified node. Any child nodes of the specified node will be * recursively deleted. * * @name gui.delete_node * @param node [type:node] node to delete * @examples * * Delete a particular node and any child nodes it might have: * * ```lua * local node = gui.get_node("my_node") * gui.delete_node(node)

Source from the content-addressed store, hash-verified

1061 * ```
1062 */
1063 static int LuaDeleteNode(lua_State* L)
1064 {
1065 DM_LUA_STACK_CHECK(L, 0);
1066
1067 HNode hnode;
1068 InternalNode* n = LuaCheckNodeInternal(L, 1, &hnode);
1069 if (n->m_Node.m_IsBone) {
1070 return luaL_error(L, "Unable to delete bone nodes");
1071 return 0;
1072 }
1073
1074 // Set deferred delete flag
1075 n->m_Deleted = 1;
1076
1077 return 0;
1078 }
1079
1080 static void LuaCurveRelease(dmEasing::Curve* curve)
1081 {

Callers

nothing calls this directly

Calls 2

LuaCheckNodeInternalFunction · 0.85
luaL_errorFunction · 0.85

Tested by

no test coverage detected