Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
retrieving game position — Gideros Forum

retrieving game position

MoKaLuxMoKaLux Member
edited March 2020 in General questions
how are you all doing?
Do you know guys how I can get the position of my game on the screen?
I know it's the second time I ask for it :)
In short I want to store the screen position so when the app quits I can restore it at the same position (like the gideros player).
I have tried this but it is not working for me!
	Accepted value for Desktop's application:get()
	- [x,y] windowPosition
	- [w,h] windowSize
	- [w,h] screenSize
	- [x,y] cursorPosition
	- [text] clipboard
	- [text] windowTitle
	- [path] directory(where//help)
	- [path] openDirectoryDialog(title|path//help)
	- [path] openFileDialog(title|path|extensions//help)
	- [path] saveFileDialog(title|path|extensions//help)
	- [path] documentDirectory
	- [path] temporaryDirectory
local x, y = application:get("windowPosition")
print(x,y) -- 0, nil ???
print(application:get("windowPosition")) -- 0 ???
print(application:get("windowSize"), application:get("screenSize")) -- 0, 0 ???
application:set("windowPosition", 64, 64) -- THIS WORKS :-)
I don't understand how to use it :(
I also had a look at github https://github.com/gideros/gideros/blob/master/libgid/src/qt/platform-qt.cpp
And the wiki https://wiki.giderosmobile.com/index.php/Application:get
Thank you in advance for your help.
PS: tested with gideros player and exported win app.
my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories


Sign In or Register to comment.