09-02-2020, 07:16 AM
Screen resources in Experiment Builder have a location property, which determines where on the screen the resource is drawn. Typically location properties contain pixel coordinates (with 0, 0 being the top left of the screen).
If the screen resolution of the project is changed in the preferences, or in the devices tab (by selecting Display from the list of devices), the screen resources will remain at their original pixel coordinates. For example, if an image was centred on a 1024 x 768 screen, its location would be 512, 384 (the middle of the screen). If the display resolution was then changed to 1920 x 1080, the image would no longer be centred but would remain at the pixel coordinates 512, 384.
If the screen resolution is changed, you will need to re-adjust the pixel coordinates for all screen resources in each DISPLAY_SCREEN adapted for the new screen resolution. Similarly, remember to double check both the X and Y positions of the any DRIFT_CORRECTION action node and any X, Y coordinates modified in any UPDATE_ATTRIBUTE nodes or the Data Source columns.
It is possible to leverage Experiment Builder's Python capabilities to dynamically reference screen locations, so that resource locations will update to reflect whatever the current screen resolution is. For example, specifying the location of a screen resource as the following will ensure that it is always positioned in the center of the screen, no matter what screen resolution is set.
If the screen resolution of the project is changed in the preferences, or in the devices tab (by selecting Display from the list of devices), the screen resources will remain at their original pixel coordinates. For example, if an image was centred on a 1024 x 768 screen, its location would be 512, 384 (the middle of the screen). If the display resolution was then changed to 1920 x 1080, the image would no longer be centred but would remain at the pixel coordinates 512, 384.
If the screen resolution is changed, you will need to re-adjust the pixel coordinates for all screen resources in each DISPLAY_SCREEN adapted for the new screen resolution. Similarly, remember to double check both the X and Y positions of the any DRIFT_CORRECTION action node and any X, Y coordinates modified in any UPDATE_ATTRIBUTE nodes or the Data Source columns.
It is possible to leverage Experiment Builder's Python capabilities to dynamically reference screen locations, so that resource locations will update to reflect whatever the current screen resolution is. For example, specifying the location of a screen resource as the following will ensure that it is always positioned in the center of the screen, no matter what screen resolution is set.
Code:
=EBPoint(@parent.parent.DISPLAY.width@/2, @parent.parent.DISPLAY.height@/2)