[window.get_size] put only ONE value in variable/table

Hi,

Those two calls on window.get_size() :

	pprint (window.get_size())
	screen_game2 = {}
	local screen_game2 = window.get_size()
	pprint (screen_game2)

Give me two different answers : Calling directly the function give me the good (X and Y sizes), but puting the function result in a table (or a simple variable : no change) give only the first answer. Like that :

DEBUG:SCRIPT: 1920,
1080
DEBUG:SCRIPT: 1920

What gives ?

My goal is, with the use of the update function from my cursor script, to have the master gui box always in the middle of the window.

Edit : Spelling

local width, height = window.get_size()

Or maybe this works local screen_game2 = table.pack(window.get_size())

1 Like

local screen_game2 = { window.get_size() }

2 Likes

Aaaahhh… That’s how it’s work. I though those functions give back a table…
Okay, first solution works well, thank you

Popota’s one works well too. Thank you.