Author Topic: Right To Left UIGrid?  (Read 6564 times)

spooky

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 16
    • View Profile
Right To Left UIGrid?
« on: June 23, 2014, 11:25:00 AM »
Is there any way to make the UIGrid organize its contents in RTL? Setting the pivot to Top Right is half way there, but each row still organizes itself in LTR.

raydenuni

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 18
    • View Profile
Re: Right To Left UIGrid?
« Reply #1 on: June 23, 2014, 01:28:47 PM »
Scale it by -1 in X?

spooky

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 16
    • View Profile
Re: Right To Left UIGrid?
« Reply #2 on: June 23, 2014, 04:10:19 PM »
That's not ideal because that flips the contents of the grid as well, making any graphics and text render backwards. Also, the scale values in the inspector are disabled by NGUI.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Right To Left UIGrid?
« Reply #3 on: June 24, 2014, 04:45:31 AM »
Specify a negative cell width, and there you go.

spooky

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 16
    • View Profile
Re: Right To Left UIGrid?
« Reply #4 on: June 24, 2014, 06:13:55 PM »
Specify a negative cell width, and there you go.

This isn't perfect, since it's a bit of work to figure out where to put the pivot, but it works. Thanks!

Edit: Actually it works fine. I'm not quite sure why, probably because of the negative math, but switching the UIGrid 'pivot' (not the containing widget's pivot) to Top Left makes the grid behave exactly how I was expecting it to.
« Last Edit: June 24, 2014, 06:23:16 PM by spooky »