Welcome,
Guest
. Please
login
or
register
.
May 31, 2026, 05:08:30 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Centered Grids and Tables
« previous
next »
Print
Pages: [
1
]
Author
Topic: Centered Grids and Tables (Read 4265 times)
BrightBit
Newbie
Thank You
-Given: 0
-Receive: 1
Posts: 21
Centered Grids and Tables
«
on:
June 24, 2014, 03:37:37 AM »
Hi,
How can I center a table or a grid in the middle of a screen or in the middle of a widget? Is there a way to change the pivot of a table from "top left" to "center"?
Greetings
BrightBit
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Centered Grids and Tables
«
Reply #1 on:
June 24, 2014, 04:55:20 AM »
No, table doesn't have a pivot. Only the grid does. You can reposition the table via code by using NGUITools.CalculateRelativeWidgetBounds to determine the bounds of the table, and then off-setting its position by half of its width and/or height.
Logged
BrightBit
Newbie
Thank You
-Given: 0
-Receive: 1
Posts: 21
Re: Centered Grids and Tables
«
Reply #2 on:
June 24, 2014, 06:08:53 AM »
A bit unintuitive but it worked. Thank you.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Centered Grids and Tables