sets the id of the specified node * * Set the id of the specicied node to a new value. * Nodes created with the gui.new_*_node() functions get * an empty id. This function allows you to give dynamically * created nodes an id. * * [icon:attention] No checking is done on the uniqueness of supplied ids. * It is up to you to make sure you use unique ids. *
| 626 | * ``` |
| 627 | */ |
| 628 | static int LuaSetId(lua_State* L) |
| 629 | { |
| 630 | int top = lua_gettop(L); |
| 631 | (void) top; |
| 632 | |
| 633 | Scene* scene = GuiScriptInstance_Check(L); |
| 634 | HNode hnode; |
| 635 | LuaCheckNodeInternal(L, 1, &hnode); |
| 636 | |
| 637 | dmhash_t id = 0; |
| 638 | if (lua_isstring(L, 2)) |
| 639 | { |
| 640 | id = dmHashString64(lua_tostring(L, 2)); |
| 641 | } |
| 642 | else |
| 643 | { |
| 644 | id = dmScript::CheckHash(L, 2); |
| 645 | } |
| 646 | dmGui::SetNodeId(scene, hnode, id); |
| 647 | |
| 648 | assert(top == lua_gettop(L)); |
| 649 | |
| 650 | return 0; |
| 651 | } |
| 652 | |
| 653 | /*# gets the named property of a specified gui node |
| 654 | * |
nothing calls this directly
no test coverage detected