All children added to the game object with this script will be repositioned to be on a grid of specified dimensions. If you want the cells to automatically set their scale based on the dimensions of their content, take a look at UITable.
More...
|
| delegate void | OnReposition () |
| |
| List< Transform > | GetChildList () |
| | Get the current list of the grid's children. More...
|
| |
| Transform | GetChild (int index) |
| | Convenience method: get the child at the specified index. Note that if you plan on calling this function more than once, it's faster to get the entire list using GetChildList() instead. More...
|
| |
| int | GetIndex (Transform trans) |
| | Get the index of the specified item. More...
|
| |
| void | AddChild (Transform trans) |
| | Convenience method – add a new child. More...
|
| |
| void | AddChild (Transform trans, bool sort) |
| | Convenience method – add a new child. Note that if you plan on adding multiple objects, it's faster to GetChildList() and modify that instead. More...
|
| |
| bool | RemoveChild (Transform t) |
| | Remove the specified child from the list. Note that if you plan on removing multiple objects, it's faster to GetChildList() and modify that instead. More...
|
| |
| virtual void | Reposition () |
| | Recalculate the position of all elements within the grid, sorting them alphabetically if necessary. More...
|
| |
| void | ConstrainWithinPanel () |
| | Constrain the grid's content to be within the panel's bounds. More...
|
| |
|
| virtual void | Init () |
| | Initialize the grid. Executed only once. More...
|
| |
| virtual void | Start () |
| | Cache everything and reset the initial position of all children. More...
|
| |
| virtual void | Update () |
| | Reset the position if necessary, then disable the component. More...
|
| |
| virtual void | Sort (List< Transform > list) |
| | You can override this function, but in most cases it's easier to just set the onCustomSort delegate instead. More...
|
| |
| void | ResetPosition (List< Transform > list) |
| | Reset the position of all child objects based on the order of items in the list. More...
|
| |
All children added to the game object with this script will be repositioned to be on a grid of specified dimensions. If you want the cells to automatically set their scale based on the dimensions of their content, take a look at UITable.
| Enumerator |
|---|
| Horizontal |
|
| Vertical |
|
| Enumerator |
|---|
| None |
|
| Alphabetic |
|
| Horizontal |
|
| Vertical |
|
| Custom |
|
| void UIGrid.AddChild |
( |
Transform |
trans | ) |
|
Convenience method – add a new child.
| void UIGrid.AddChild |
( |
Transform |
trans, |
|
|
bool |
sort |
|
) |
| |
Convenience method – add a new child. Note that if you plan on adding multiple objects, it's faster to GetChildList() and modify that instead.
| void UIGrid.ConstrainWithinPanel |
( |
| ) |
|
Constrain the grid's content to be within the panel's bounds.
| Transform UIGrid.GetChild |
( |
int |
index | ) |
|
Convenience method: get the child at the specified index. Note that if you plan on calling this function more than once, it's faster to get the entire list using GetChildList() instead.
| List<Transform> UIGrid.GetChildList |
( |
| ) |
|
Get the current list of the grid's children.
| int UIGrid.GetIndex |
( |
Transform |
trans | ) |
|
Get the index of the specified item.
| virtual void UIGrid.Init |
( |
| ) |
|
|
protectedvirtual |
Initialize the grid. Executed only once.
| delegate void UIGrid.OnReposition |
( |
| ) |
|
| bool UIGrid.RemoveChild |
( |
Transform |
t | ) |
|
Remove the specified child from the list. Note that if you plan on removing multiple objects, it's faster to GetChildList() and modify that instead.
| virtual void UIGrid.Reposition |
( |
| ) |
|
|
virtual |
Recalculate the position of all elements within the grid, sorting them alphabetically if necessary.
| void UIGrid.ResetPosition |
( |
List< Transform > |
list | ) |
|
|
protected |
Reset the position of all child objects based on the order of items in the list.
| virtual void UIGrid.Sort |
( |
List< Transform > |
list | ) |
|
|
protectedvirtual |
You can override this function, but in most cases it's easier to just set the onCustomSort delegate instead.
| static int UIGrid.SortByName |
( |
Transform |
a, |
|
|
Transform |
b |
|
) |
| |
|
static |
| static int UIGrid.SortHorizontal |
( |
Transform |
a, |
|
|
Transform |
b |
|
) |
| |
|
static |
| static int UIGrid.SortVertical |
( |
Transform |
a, |
|
|
Transform |
b |
|
) |
| |
|
static |
| virtual void UIGrid.Start |
( |
| ) |
|
|
protectedvirtual |
Cache everything and reset the initial position of all children.
| virtual void UIGrid.Update |
( |
| ) |
|
|
protectedvirtual |
Reset the position if necessary, then disable the component.
| bool UIGrid.animateSmoothly = false |
Whether the grid will smoothly animate its children into the correct place.
| Arrangement UIGrid.arrangement = Arrangement.Horizontal |
Type of arrangement – vertical or horizontal.
| float UIGrid.cellHeight = 200f |
The height of each of the cells.
| float UIGrid.cellWidth = 200f |
The width of each of the cells.
| bool UIGrid.hideInactive = true |
Whether to ignore the disabled children or to treat them as being present.
| bool UIGrid.keepWithinPanel = false |
Whether the parent container will be notified of the grid's changes.
| int UIGrid.maxPerLine = 0 |
Maximum children per line. If the arrangement is horizontal, this denotes the number of columns. If the arrangement is vertical, this stands for the number of rows.
| bool UIGrid.mInitDone = false |
|
protected |
| bool UIGrid.mReposition = false |
|
protected |
| System.Comparison<Transform> UIGrid.onCustomSort |
Custom sort delegate, used when the sorting method is set to 'custom'.
Callback triggered when the grid repositions its contents.
Final pivot point for the grid's content.
| Sorting UIGrid.sorting = Sorting.None |
How to sort the grid's elements.
| bool UIGrid.repositionNow |
|
set |
Reposition the children on the next Update().
The documentation for this class was generated from the following file:
- D:/Projects/NGUI/Assets/NGUI/Scripts/Interaction/UIGrid.cs