09-02-2020, 07:16 AM
Screen resources in Experiment Builder, like images or text, are positioned using a location property that contains specific pixel coordinates (e.g., 512, 384). The origin (0, 0) of the screen coordinate space is the top-left corner of the screen. When you change the project's screen resolution (either in Preferences or the Devices tab), the dimensions of the screen space will change, but the location of the location of the screen elements will stay the same and will not scale to reflect the change in screen resolution. For example, if an image was centered on a 1024x768 screen (at 512, 384) and you changed the project resolution to 1920x1080, the image would no longer be centered. The image would remain at the pixel location 512, 384 which is no longer the center of the display.
If you change the screen resolution, you must manually re-adjust the pixel coordinates for all screen resources to fit the new resolution.
Remember to check and update the X/Y coordinates in the following places:
Alternatively, if your screen elements should always be scaled in a specific way relative to the overall resolution then you can replace the fixed pixel locations with an equation relative to the project resolution. For example, to always position a resource in the center of the screen, set its location property to an equation that references half the vertical and horizontal pixel resolution of the screen:
This equation dynamically references the current width and height of the project's resolution settings and calculates the center point, making the position of the object resolution-independent.
If you change the screen resolution, you must manually re-adjust the pixel coordinates for all screen resources to fit the new resolution.
Remember to check and update the X/Y coordinates in the following places:
- All resources in every DISPLAY_SCREEN node.
- The target location in any DRIFT_CORRECTION action.
- Any X/Y coordinates modified in UPDATE_ATTRIBUTE nodes or Data Source columns.
Alternatively, if your screen elements should always be scaled in a specific way relative to the overall resolution then you can replace the fixed pixel locations with an equation relative to the project resolution. For example, to always position a resource in the center of the screen, set its location property to an equation that references half the vertical and horizontal pixel resolution of the screen:
Code:
=EBPoint(@parent.parent.DISPLAY.width@/2, @parent.parent.DISPLAY.height@/2)
This equation dynamically references the current width and height of the project's resolution settings and calculates the center point, making the position of the object resolution-independent.