[0.16.51] Style.width/height is incorret.
Posted: Fri Nov 09, 2018 12:44 pm
What
Applying LuaGuiElement.style.height/width = 128 for example does not make a 128x128 element. Reproduce
At standard zoom (F9) the problem is quite obvious even in the in-game grid. Though i discovered it by measuring pixels on a screenshot. The deviation seems to depend on the size of factorios game window.
Why?
I'm trying to get a screen-sized window but using display_resolution makes it larger than the screen.
Applying LuaGuiElement.style.height/width = 128 for example does not make a 128x128 element. Reproduce
Code: Select all
/c
game.player.gui.center.clear()
x = game.player.gui.center.add{type='frame'}
x.style.width = 128
x.style.height=128
Why?
I'm trying to get a screen-sized window but using display_resolution makes it larger than the screen.
Code: Select all
/c
game.player.gui.center.clear()
x = game.player.gui.center.add{type='frame'}
x.style.width = game.player.display_resolution.width
x.style.height=game.player.display_resolution.height