| Reference | Downloads | Github

RatingScale from "norm" to "cm" units


I’ve build my experiment using the ‘cm’ unit in order to avoid any distortion across the different monitors’ sizes in which it has to be run. However, I need to use the RatingScale class and modify the ‘size’, ‘stretch’ and ‘pos’ parameters, which are all in ‘norm’ units and thus are distorted when the monitor’s size changes. Is there any way to avoid this distortion? maybe by adjusting the parameters as a function of the screen size?

Any input would be appreciated. Thank you.

Have you had a look at the tools.monitorunittools?

It doesn’t feature conversion functions to norm, but it does convert to pixels - which you can then turn into norm by subtracting half of the screen size (in pix) and then dividing by the screensize. It would be something like

normStretch = (yourCmStretch / yourMonitor.getSizePix()[0]) - 0.5
normPos = [yourCmPos[dimension] / yourMonitor.getSizePix()[dimension] - 0.5 for dimension in range(2)]

It would be nice if monitorunittols did have a conversion to norm, actually.