Window.width Does Not Equal Screen Resolution

So I added a rectangle to my prototype (ResolutionTest.rp) called “Test”. I then added the following to OnPageLoad and to OnWindowResize

Set text on Test to “Width: [[Window.width]]
Height: [[Window.height]]”
Move Test to ([[Window.width/2-LVAR1.width/2]],[[Window.height/2-LVAR1.height/2]])
note: LVAR1 = widget “Test”

When I run the prototype, the “Test” box show the screen width and height as 2133 and 1018, respectively. Additionally, the “Test” box is perfectly centered in the browser window.

PROBLEM: My resolution is set at 1920 x 1080.

What am I missing?

ResolutionTest.rp (45.1 KB)

Hello! It looks like you’re seeing that the reported width and height of the browser window is larger than your screen’s resolution. The value being pulled is referencing the width and height of the browser window, rather than the width and height of your monitor. The StackOverflow post linked below has more information on this to help clarify the situation that you’re running into:

Hopefully that helps!

1 Like