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

Function LuaGetId

engine/gui/src/gui_script.cpp:547–560  ·  view source on GitHub ↗

gets the id of the specified node * * Retrieves the id of the specified node. * * @name gui.get_id * @param node [type:node] the node to retrieve the id from * @return id [type:hash] the id of the node * @examples * * Gets the id of a node: * * ```lua * local node = gui.get_node("my_node") * * local id = gui.get_id(node) *

Source from the content-addressed store, hash-verified

545 * ```
546 */
547 static int LuaGetId(lua_State* L)
548 {
549 int top = lua_gettop(L);
550 (void) top;
551
552 HNode hnode;
553 InternalNode* n = LuaCheckNodeInternal(L, 1, &hnode);
554
555 dmScript::PushHash(L, n->m_NameHash);
556
557 assert(top + 1 == lua_gettop(L));
558
559 return 1;
560 }
561
562 /*# gets the node type
563 *

Callers

nothing calls this directly

Calls 4

lua_gettopFunction · 0.85
LuaCheckNodeInternalFunction · 0.85
PushHashFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected