Questions about lua scripting in Spring

Questions about lua scripting in Spring

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Questions about lua scripting in Spring

Post 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.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Questions about lua scripting in Spring

Post by Kloot »

1: Nope
2: Have a look at the Get*Geometry callouts (read-only)
3: See #2
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Questions about lua scripting in Spring

Post 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.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Questions about lua scripting in Spring

Post 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.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Questions about lua scripting in Spring

Post by imbaczek »

window position is now saved across runs by the engine.
Post Reply

Return to “Lua Scripts”