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

Function LuaIsEnabled

engine/gui/src/gui_script.cpp:3496–3509  ·  view source on GitHub ↗

returns if a node is enabled or not * Returns `true` if a node is enabled and `false` if it's not. * Disabled nodes are not rendered and animations acting on them are not evaluated. * * @name gui.is_enabled * @param node [type:node] node to query * @param [recursive] [type:boolean] check hierarchy recursively * @return enabled [type:boolean] whether the node is e

Source from the content-addressed store, hash-verified

3494 * @return enabled [type:boolean] whether the node is enabled or not
3495 */
3496 static int LuaIsEnabled(lua_State* L)
3497 {
3498 DM_LUA_STACK_CHECK(L, 1);
3499 HNode hnode;
3500 InternalNode* n = LuaCheckNodeInternal(L, 1, &hnode);
3501 (void) n;
3502
3503 Scene* scene = GuiScriptInstance_Check(L);
3504 int top = lua_gettop(L);
3505 bool recursive = top >= 2 && lua_toboolean(L, 2);
3506 lua_pushboolean(L, dmGui::IsNodeEnabled(scene, hnode, recursive));
3507
3508 return 1;
3509 }
3510
3511 /*# enables/disables a node
3512 * Sets a node to the disabled or enabled state.

Callers

nothing calls this directly

Calls 6

LuaCheckNodeInternalFunction · 0.85
GuiScriptInstance_CheckFunction · 0.85
lua_gettopFunction · 0.85
lua_tobooleanFunction · 0.85
lua_pushbooleanFunction · 0.85
IsNodeEnabledFunction · 0.70

Tested by

no test coverage detected