UMG incorrectly positioning widgets

RhythmScript
Mon, 10 Nov 2014 22:41:57 +0000
UI

…that, or the “Viewport Size” node returns incorrect values.

I’m trying to place a lock-on cursor and running into some issues. In the pursuit of debugging the problem, I discovered a really irritating bug: positioning a Canvas slot doesn’t ACTUALLY reflect the proper screen size!

See attached pic:

As you can see, I’m PrintString-ing the Viewport X dimension to prove a point: PIE, the dimensions are 1291 x (something). So, for a widget Anchored to the upper-left of the Root Canvas, and with Alignment set to 0.5 x 0.5, this widget SHOULD appear centered over whatever screen dimensions I feed it. Right?

But, see here: I manually feed it a position of 1290. Now, with the reported Viewport size, that should place it halfway off the screen on the right side (with the center of the widget right at the edge of the viewport) Instead, the game just sort of shoves it over. Arbitrarily, it takes an X value of about 1540 to ACTUALLY place the widget on the edge of the screen; this value doesn’t seem to be related to anything at all (since not only is it not the viewport’s size, but the canvas and game target are 1920x1080, so it’s not related to any underlying assumptions about resolution)

I cannot for the life of me figure out why this thing is acting like this. It seems to me that if I feed it screen coordinates, it should appear at those coordinates, but instead it seems to do some sort of arbitrary adjusting of the screen dimensions.

19 posts - 9 participants