Page 1 of 1

Usage of 'display_density_scale'

Posted: Wed Dec 18, 2024 12:23 pm
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