Usage of 'display_density_scale'

Place to get help with not working mods / modding interface.
chexx
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Dec 18, 2024 8:24 am
Contact:

Usage of 'display_density_scale'

Post by chexx »

Hi,
in 1.1, I'm used to adjust (GUI) coordinates like this:

Code: Select all

local scale = player.display_scale
-- get/calculate some x/y
local pos = {x * scale, y * scale}
I'm a little bit confused with the new (2.0) attribute 'display_density_scale' and its documentation. Is it meant to be used like this?

Code: Select all

local scale = player.display_scale
local density_scale = player.display_density_scale
-- get/calculate some x/y
local pos = {x * scale * density_scale, y * scale * density_scale}
I'm concerned about two use-cases for seamless integration:
- providing width and height for a frame/flow control
- rendering objects on a surface

As I do not (yet) have access to a high-density display for testing/evaluating, I'm wondering if anybody has some experience with this...

TIA, chexx
Post Reply

Return to “Modding help”