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

Function LuaPickNode

engine/gui/src/gui_script.cpp:3472–3485  ·  view source on GitHub ↗

determines if the node is pickable by the supplied coordinates * Tests whether a coordinate is within the bounding box of a * node. * * @name gui.pick_node * @param node [type:node] node to be tested for picking * @param x [type:number] x-coordinate (see on_input ) * @param y [type:number] y-coordinate (see on_input

Source from the content-addressed store, hash-verified

3470 * @return pickable [type:boolean] pick result
3471 */
3472 static int LuaPickNode(lua_State* L)
3473 {
3474 HNode hnode;
3475 InternalNode* n = LuaCheckNodeInternal(L, 1, &hnode);
3476 (void) n;
3477
3478 lua_Number x = luaL_checknumber(L, 2);
3479 lua_Number y = luaL_checknumber(L, 3);
3480
3481 Scene* scene = GuiScriptInstance_Check(L);
3482
3483 lua_pushboolean(L, PickNode(scene, hnode, (float) x, (float) y));
3484 return 1;
3485 }
3486
3487 /*# returns if a node is enabled or not
3488 * Returns `true` if a node is enabled and `false` if it's not.

Callers

nothing calls this directly

Calls 5

LuaCheckNodeInternalFunction · 0.85
luaL_checknumberFunction · 0.85
GuiScriptInstance_CheckFunction · 0.85
lua_pushbooleanFunction · 0.85
PickNodeFunction · 0.70

Tested by

no test coverage detected