summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/test_screen_position.lua
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2024-10-08 15:40:12 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2024-10-08 15:40:12 +0300
commitccc7fffb22b347149bf807b9d92677e5616c5017 (patch)
tree44a3abe1b70e48daacda86ebf77cdc56abd6da0f /indra/newview/scripts/lua/test_screen_position.lua
parent8a44149b481bf118d30a457514711c6ba4cf29b6 (diff)
Lua api to get avatar screen position
Diffstat (limited to 'indra/newview/scripts/lua/test_screen_position.lua')
-rw-r--r--indra/newview/scripts/lua/test_screen_position.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/indra/newview/scripts/lua/test_screen_position.lua b/indra/newview/scripts/lua/test_screen_position.lua
new file mode 100644
index 0000000000..94d57339b1
--- /dev/null
+++ b/indra/newview/scripts/lua/test_screen_position.lua
@@ -0,0 +1,8 @@
+LLAgent = require 'LLAgent'
+
+local screen_pos = LLAgent.getAgentScreenPos()
+if screen_pos.onscreen then
+ print("Avatar screen coordinates X: " .. screen_pos.x .. " Y: " .. screen_pos.y)
+else
+ print("Avatar is not on the screen")
+end