Author Topic: How to create a top aligned grid?  (Read 3899 times)

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
How to create a top aligned grid?
« on: June 15, 2015, 09:48:06 AM »
Adding a grid anchored to the screen that stretches from top to bottom, I want items inside to be listed down from the top of this grid. Yet the items I add are always grouped around the centre no matter what settings I try.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to create a top aligned grid?
« Reply #1 on: June 16, 2015, 12:50:21 PM »
Grid anchored to the screen? Grid is just a script that repositions children. It's not a widget, so it can't be anchored. That said, you can use a legacy UIAnchor to anchor it if you like. You'll achieve the result you're looking for that way. Although you can do the same thing by making a UIWidget (ALT+SHIFT+W), changing it to have a top pivot, anchoring it, then making your grid be a child of that widget.

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Re: How to create a top aligned grid?
« Reply #2 on: June 17, 2015, 04:01:36 PM »
Okay. I had a grid as a child object correctly, but didn't understand the pivots.

For clarity to anyone else who comes across this, use the Widgets' 'Pivots' to adjust your layouts. Set the Widget's top pivot, and then the items to also have a top-aligned pivot so. The pivot of the grid is about where the items are arranged, but doesn't control their offset or position in the parent widget.