Page 1 of 1

Questions about lua scripting in Spring

Posted: 28 Mar 2009, 12:42
by slogic
1) There is SetCameraOffset(). Is there GetCameraOffset()?
2) Can i access to Spring window properties? I need to store & restore its left corner position. Or should it be done in the engine?
3) How can i get screen (dektop) resolution? Don't mess with the game resolution cause i can run the game in windowed mode. I see many widgets which uses constant 0.75 to make a proportional scale in Y-axis. This is false in 1280x1024 resolution.

Re: Questions about lua scripting in Spring

Posted: 28 Mar 2009, 13:24
by Kloot
1: Nope
2: Have a look at the Get*Geometry callouts (read-only)
3: See #2

Re: Questions about lua scripting in Spring

Posted: 28 Mar 2009, 13:55
by slogic
Thanx. Concerning the first item I found these functions nearby Get*Geometry definition:

Code: Select all

		static int GetCameraState(lua_State* L);
		static int GetCameraPosition(lua_State* L);
		static int GetCameraDirection(lua_State* L);
		static int GetCameraVectors(lua_State* L);
Have to find out how do they correlate with SetCameraOffset() arguments.

Pity i can't change the window position from inside Lua. Going to report to Mantis. I hate fixing the window position every game launch.

Re: Questions about lua scripting in Spring

Posted: 31 Mar 2009, 17:53
by CarRepairer
slogic wrote:Pity i can't change the window position from inside Lua. Going to report to Mantis. I hate fixing the window position every game launch.
This is the doing of the lobby client and operating system.

Re: Questions about lua scripting in Spring

Posted: 01 Apr 2009, 03:47
by imbaczek
window position is now saved across runs by the engine.