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

Function LuaSetScreenPosition

engine/gui/src/gui_script.cpp:4508–4516  ·  view source on GitHub ↗

sets screen position to the node * * Set the screen position to the supplied node * * @name gui.set_screen_position * @param node [type:node] node to set the screen position to * @param screen_position [type:vector3] screen position */

Source from the content-addressed store, hash-verified

4506 * @param screen_position [type:vector3] screen position
4507 */
4508 int LuaSetScreenPosition(lua_State* L)
4509 {
4510 DM_LUA_STACK_CHECK(L, 0);
4511 Scene* scene = GuiScriptInstance_Check(L);
4512 InternalNode* node = LuaCheckNodeInternal(L, 1, 0);
4513 Point3 screen_position = GetPositionFromArgumentIndex(L, 2);
4514 SetScreenPosition(scene, GetNodeHandle(node), screen_position);
4515 return 0;
4516 }
4517
4518 /*# convert screen position to the local node position
4519 *

Callers

nothing calls this directly

Calls 5

GuiScriptInstance_CheckFunction · 0.85
LuaCheckNodeInternalFunction · 0.85
SetScreenPositionFunction · 0.70
GetNodeHandleFunction · 0.70

Tested by

no test coverage detected