Forum rules - please read before posting.

[Request] Alternative solution to SetCentre to also have the Anchors positioned appropriately

Hi there!

I somehow managed to center the UI of the game using the SetCentre method, and it works fine for Rects that are screen centered.
(I'm using AC's forced aspect ratio, also while calling SetCentre, Canvas set to Screen space overlay and Canvas Scaler set to Scale with Screen Size-Expand)

Yet, instead of setting the height and the width of such rect, I'd love to have a Rect that mimiks the "Expand to fit" behaviour of a rect.

There's a simple reason for that: I can't do any position snapping when building the prefab UI using uGUI (or, there's a way I'm not aware of).

At the moment I had to reinvent all UIs to be usable when originating from the centre of the screen/render area, instead of just snapping from the corners/Anchors.

So far it's... sort of fine, but makes creating the UI in uGUI a bit too much... centre based, and I can't use any sort of snapping, as all elements have to be positioned relative to the centre.

Am I missing something, or there's a workaround for this?

I'm thinking about games which don't have a forced aspect ratio, so they have to feature a "liquid layout".

Comments

  • For such a visual problem, I would need a clear example of a typical situation. If you can provide steps to recreate the issue, I will look into it.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.