The silver box indicates the Anchor point and will move the Anchor Medallion to that location once selected. This is probably the most common method of setting an Anchor point for your Widgets and should cover most of your needs. With a UI Widget placed on a Canvas Panel, you can select a Preset Anchor from the Details panel of the Widget.
You can also "break apart" the Anchor Medallion for more options on how your Widgets respond to varying screen sizes (see the Manual Anchors section for more information). This example illustrates how you can define the Anchor location and how its location can affect the position of your Widgets depending on the screen sizes. The Button is shifted in to avoid being cropped off screen due to the position of the Anchor's location in the lower right (yellow box). If we move the Anchor to the lower right instead.Īnd play in game again with the same viewport size. Playing in game, depending upon viewport size, we might see something like below where the yellow box represents the Anchor point:īased on our viewport size, the Button is shifted off screen. It is a good habit to check your UI widgets to see how they will appear on different screen sizes or aspect ratios and adjust accordingly. In the lower left corner of the window (inside the yellow box) you can see the Screen Size of the Canvas you are working with.Ĭlick the Screen Size Button in the graph to change the currently used size. The horizontal yellow line tells the Button how much to move from the Anchor along the X axis, again based on Canvas size and starting from the upper left of the viewport. The vertical yellow line above tells the Button how much to move from the Anchor along the Y axis based on the Canvas size, starting in the upper left of the viewport. In the image below, we have a Button placed on a Canvas Panel and we have left the Anchor at the default location (upper left).
Inside the yellow box below is the Anchor Medallion which represents the Anchor position on the Canvas Panel.
Once you have a Canvas Panel and add other UI Widgets to it, you can either select from a number of preset Anchor positions (typically, selecting one of these should do if you only want to keep your Widget at a specific location) or you can manually set the Anchor position and Min/Max settings as well as applying offsets. Anchors are normalized where Min(0,0) and Max(0,0) is the upper left corner and Min(1,1) and Max(1,1) is the bottom right corner. Anchors are used to define a UI widget's desired location on a Canvas Panel and maintains that position with varying screen sizes.