a way to get a players screen resolution
a way to get a players screen resolution
I'd like to get implemented a way to pull information on a players screen size to make it possible to adjust a large dialog to the players screen without the player having to input the resolution themselves.
It'd also require an event to handle resolution changes in order to resize the dialog.
It'd also require an event to handle resolution changes in order to resize the dialog.
Re: a way to get a players screen resolution
To save some dev time: Not gonna happen. This isn't deterministic.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: a way to get a players screen resolution
Yep. Very unlikely to ever happen. If you absolutely need this you can make per-player mod options for it. Or just use a "scroll-pane". (I can relate to the problem though *sigh*)
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: a way to get a players screen resolution
As other have said: that's not currently possible. However since it sounds like it could be quite useful for mod developers I may look into adding support for it.
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: a way to get a players screen resolution
To me the "i want the screen resolution" thing is mostly a dilemma because it's not currently possible to specify relative sizes for GUI elements. I.e. i'd like to specify "this GUI frame should be 70% of the current window width and 60% of the current window height". Resolution would (to me) be simply an entry point to calculate those percentages myself. So personally i'd be far more interested in something like LuaGuiElement.style.relative_width = 0.6. Tho i guess knowing the absolute dimensions might still have some benefits when trying to work with very small windows...Rseding91 wrote:As other have said: that's not currently possible. However since it sounds like it could be quite useful for mod developers I may look into adding support for it.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: a way to get a players screen resolution
That could work but since there's no such concept in the GUI logic it's not something that can be done in any acceptable amount of time. Knowing the players screen resolution and display scale value would allow mods to set up their GUIs exactly how the core game does and that can be done in an acceptable amount of time.eradicator wrote:To me the "i want the screen resolution" thing is mostly a dilemma because it's not currently possible to specify relative sizes for GUI elements. I.e. i'd like to specify "this GUI frame should be 70% of the current window width and 60% of the current window height". Resolution would (to me) be simply an entry point to calculate those percentages myself. So personally i'd be far more interested in something like LuaGuiElement.style.relative_width = 0.6. Tho i guess knowing the absolute dimensions might still have some benefits when trying to work with very small windows...Rseding91 wrote:As other have said: that's not currently possible. However since it sounds like it could be quite useful for mod developers I may look into adding support for it.
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: a way to get a players screen resolution
I'm definetly not going to complain if we can get on_resolution_changed and player.resolution . It's still far superior than asking the player to manually add mod settings... (i kinda suspected relative size would be to time consuming to integrate now)Rseding91 wrote: That could work but since there's no such concept in the GUI logic it's not something that can be done in any acceptable amount of time. Knowing the players screen resolution and display scale value would allow mods to set up their GUIs exactly how the core game does and that can be done in an acceptable amount of time.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: a way to get a players screen resolution
I'm not gonna complain either. I'll probably go the route of helmod for now and have a dropdown available on the per-user mod configuration menu.eradicator wrote:I'm definetly not going to complain if we can get on_resolution_changed and player.resolution . It's still far superior than asking the player to manually add mod settings... (i kinda suspected relative size would be to time consuming to integrate now)Rseding91 wrote:...
Re: a way to get a players screen resolution
I've added support to read a given players display resolution for 0.16.
The resolution will be what ever the game window is running at.
The resolution will be what ever the game window is running at.
If you want to get ahold of me I'm almost always on Discord.
Re: a way to get a players screen resolution
How will that not turn into broken replays?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: a way to get a players screen resolution
It operates the same way keyboard and mouse input does so you aren't actually reading the live display resolution but what the game was last told it is.Bilka wrote:How will that not turn into broken replays?
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: a way to get a players screen resolution
All hail to the great Rsed.Rseding91 wrote:I've added support to read a given players display resolution for 0.16.
The resolution will be what ever the game window is running at.
(and once again i notice a severe lack of a :worship: simley on the forums )
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.