Public Types | |
enum | ORIENTATION |
enum | DIRECTION { TtoB_LtoR, BtoT_RtoL } |
enum | ALIGNMENT { LEFT_TOP, CENTER, RIGHT_BOTTOM } |
Determines how items will be aligned within the list when added. More... | |
Public Member Functions | |
delegate void | ItemSnappedDelegate (IUIListObject item) |
Delegate definition for a delegate that receives a notification when the list snaps to an item. | |
void | UpdateCamera () |
Updates any camera-dependent settings, such as the calculated pixel-perfect size. Use this with BroadcastMessage() to do bulk re-calculation of object sizes whenever your screensize/resolution changes at runtime. | |
void | ScrollListTo (float pos) |
Scrolls the list directly to the position indicated (0-1). | |
void | ScrollToItem (IUIListObject item, float scrollTime, EZAnimation.EASING_TYPE easing) |
Scrolls the list to the specified item in the specified number of seconds. | |
void | ScrollToItem (int index, float scrollTime, EZAnimation.EASING_TYPE easing) |
Scrolls the list to the specified item in the specified number of seconds. | |
void | ScrollToItem (IUIListObject item, float scrollTime) |
Scrolls the list to the specified item in the specified number of seconds. | |
void | ScrollToItem (int index, float scrollTime) |
Scrolls the list to the specified item in the specified number of seconds. | |
void | SetViewableAreaPixelDimensions (Camera cam, int width, int height) |
Sizes the viewable area of the scroll list using pixel dimensions as the unit of measurement. | |
void | InsertItem (IUIListObject item, int position) |
Inserts a list item at the specified position in the list. | |
void | InsertItem (IUIListObject item, int position, bool doEasing) |
Inserts a list item at the specified position in the list. | |
void | InsertItem (IUIListObject item, int position, string text) |
Inserts a list item at the specified position in the list. | |
void | InsertItem (IUIListObject item, int position, string text, bool doEasing) |
Inserts a list item at the specified position in the list. | |
void | AddItem (GameObject itemGO) |
Adds an item to the end of the list. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size. | |
void | AddItem (IUIListObject item) |
Adds an item to the end of the list. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size. | |
void | AddItem (IUIListObject item, string text) |
Adds an item to the end of the list. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size. | |
IUIListObject | CreateItem (GameObject prefab) |
Instantiates a new list item based on the prefab to clone, adds it to the end of the list and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size. | |
IUIListObject | CreateItem (GameObject prefab, string text) |
Instantiates a new list item based on the prefab to clone, adds it to the end of the list and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size. | |
IUIListObject | CreateItem (GameObject prefab, int position, bool doEasing) |
Instantiates a new list item based on the prefab to clone, adds it to the list at the position specified by "position" and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size. | |
IUIListObject | CreateItem (GameObject prefab, int position) |
Instantiates a new list item based on the prefab to clone, adds it to the list at the position specified by "position" and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size. | |
IUIListObject | CreateItem (GameObject prefab, int position, string text) |
Instantiates a new list item based on the prefab to clone, adds it to the list at the position specified by "position" and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size. | |
IUIListObject | CreateItem (GameObject prefab, int position, string text, bool doEasing) |
Instantiates a new list item based on the prefab to clone, adds it to the list at the position specified by "position" and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size. | |
void | PositionItems () |
Positions list items according to the current scroll position. | |
void | RepositionItems () |
Repositions list items according to the current scroll position, and adjusts for any change in the items' extents. | |
void | SetSelectedItem (int index) |
Sets the item at the specified index as the currently selected item. | |
IUIListObject | GetItem (int index) |
Returns a reference to the specified list item. | |
void | RemoveItem (int index, bool destroy) |
Removes the item at the specified index. Remaining items are repositioned to fill the gap. The removed item is destroyed if 'destroy' is true. Otherwise, it is deactivated. | |
void | RemoveItem (int index, bool destroy, bool doEasing) |
Removes the item at the specified index. Remaining items are repositioned to fill the gap. The removed item is destroyed if 'destroy' is true. Otherwise, it is deactivated. | |
void | RemoveItem (IUIListObject item, bool destroy) |
Removes the specified item. Remaining items are repositioned to fill the gap. The removed item is destroyed if 'destroy' is true. Otherwise, it is deactivated. | |
void | RemoveItem (IUIListObject item, bool destroy, bool doEasing) |
Removes the specified item. Remaining items are repositioned to fill the gap. The removed item is destroyed if 'destroy' is true. Otherwise, it is deactivated. | |
void | ClearList (bool destroy) |
Empties the contents of the list entirely. Destroys the items if instructed, otherwise it just deactivates them. | |
void | OnInput (POINTER_INFO ptr) |
This is where input handling code should go in any derived class. | |
void | SetInputDelegate (EZInputDelegate del) |
Sets the method to be called when input occurs (input is forwarded from OnInput()). NOTE: This will replace any and all delegates which have been set or added previously. If you are unsure if any delegates are already registered, use AddInputDelegate() instead, or RemoveInputDelegate() to unset a previously registered delegate. Only use this when you are sure you want to replace all previously registered delegates. | |
void | AddInputDelegate (EZInputDelegate del) |
Adds a method to be called when input occurs (input is forwarded from OnInput()). | |
void | RemoveInputDelegate (EZInputDelegate del) |
Removes a method added with AddInputDelegate(). | |
void | SetValueChangedDelegate (EZValueChangedDelegate del) |
Sets the method to be called when the value of a control changes (such as a checkbox changing from false to true, or a slider being moved). NOTE: This will replace any and all delegates which have been set or added previously. If you are unsure if any delegates are already registered, use AddValueChangedDelegate() instead, or RemoveValueChangedDelegate() to unset a previously registered delegate. Only use this when you are sure you want to replace all previously registered delegates. | |
void | AddValueChangedDelegate (EZValueChangedDelegate del) |
Adds a method to be called when the value of a control changes (such as a checkbox changing from false to true, or a slider being moved). | |
void | RemoveValueChangedDelegate (EZValueChangedDelegate del) |
Removes a method added with AddValueChangedDelegate(). | |
void | AddItemSnappedDelegate (ItemSnappedDelegate del) |
Adds a delegate to be called when the list snaps to an item. | |
void | RemoveItemSnappedDelegate (ItemSnappedDelegate del) |
Removes a delegate from the list of those to be called when the list snaps to an item. | |
void | CancelDrag () |
Cancels any pending drag and drop operation. | |
void | AddDragDropDelegate (EZDragDropDelegate del) |
Adds a delegate to be called with drag and drop notifications. | |
void | RemoveDragDropDelegate (EZDragDropDelegate del) |
Removes a delegate from the list of those to be called with drag and drop notifications. | |
void | SetDragDropDelegate (EZDragDropDelegate del) |
Sets the delegate to be called with drag and drop notifications. NOTE: This will replace any previously registered delegates. | |
Static Public Member Functions | |
static UIScrollList | Create (string name, Vector3 pos) |
Creates a GameObject and attaches this component type to it. | |
static UIScrollList | Create (string name, Vector3 pos, Quaternion rotation) |
Creates a GameObject and attaches this component type to it. | |
Public Attributes | |
bool | touchScroll = true |
When true, scrolling will operate like a scrollable list on an iPhone - when a pointing device (normally a finger) is dragged across it, it scrolls and coasts to an eventual stop if not stopped manually. | |
float | scrollWheelFactor = 100f |
The factor by which any mouse scrollwheel delta is multiplied to arrive at how far the list should be scrolled in response. To make your list scroll faster or slower in response to mousewheel input, increase or decrease this value, respectively. | |
float | scrollDecelCoef = 0.04f |
The scroll deceleration coefficient. This value determines how quickly a touch scroll will coast to a stop. When using snapping, this also essentially determines which item will be snapped to when the list is let go. If you want to always scroll one item at a time, for example, set this value high. | |
bool | snap = false |
When true, the scroll position will "snap" so that the item nearest the center of the list will snap to the center, provided it wouldn't take us past the edge of the list. | |
float | minSnapDuration = 1f |
The minimum number of seconds a snap should last. | |
EZAnimation.EASING_TYPE | snapEasing = EZAnimation.EASING_TYPE.ExponentialOut |
The type of easing to use when snapping to an item. | |
UISlider | slider |
An optional slider control that will control the scroll position of the list. | |
ORIENTATION | orientation |
The orientation of the list - horizontal or vertical. | |
DIRECTION | direction = DIRECTION.TtoB_LtoR |
Determines whether items will be added to the list from top-to-bottom and left-to-right, or from bottom-to-top and right-to-left. See UIScrollList.DIRECTION [DIRECTION]. | |
ALIGNMENT | alignment = ALIGNMENT.CENTER |
Determines how the items will be aligned in the list when added. See UIScrollList.ALIGNMENT [ALIGNMENT]. | |
Vector2 | viewableArea |
The extents of the viewable area, in local space units. The contents of the list will be clipped to this area. Ex: If an area of 10x10 is specified, the list contents will be clipped 5 units above the center of the scroll list's GameObject, 5 units below, and 5 units on either side. | |
bool | unitsInPixels = false |
When true, the viewableArea itemSpacing, etc, are interpreted as being specified in screen pixels. | |
Camera | renderCamera |
The camera that will render this list. This needs to be set when unitsInPixels is set to true or when you have prefab items that need to know which camera to use to size themselves. | |
float | itemSpacing |
Empty space to put between each list item. | |
bool | spacingAtEnds = true |
When set to true, the itemSpacing value will be applied before the first item, and after the last so as to "pad" the first and last items a bit from the edge. If false, the first and last items will be flush with the edges of the viewable area. | |
float | extraEndSpacing = 0 |
Adds the specified amount of extra space to the ends of the list (before the first item, and after the last). This value is in local units if "unitsInPixels" is false, or in pixels if it is true. | |
bool | activateWhenAdding = true |
When true, items added or inserted to this list will be activated recursively. This is STRONGLY recommended when using managed sprites/controls. | |
bool | clipContents = true |
When true, the contents of the list will be clipped to the viewable area. Otherwise, the content will extend beyond the specified viewable area. | |
bool | clipWhenMoving = false |
When true, items will be clipped each frame in which it is detected that the list has moved, rotated, or scaled. Use this if you are having clipping errors after scaling, rotating, etc, a list as part of a panel transition, etc. Leave set to false otherwise to improve performance. | |
bool | positionItemsImmediately = true |
When set to true, items added to the list will be positioned in the list immediately so that any immediately following code that does something to the list that depends on the new item positioning such as ScrollToItem(), etc, will take the new list contents into account. Otherwise, if left set to false, items are positioned in the list at the end of the frame in which they were added (inside LateUpdate()). If you are adding lots of items to a list in batches, you can save a lot of performance by setting this setting to false so that the items all get positioned in one batch. But if you are having problems with ScrollToItem() or other similar features not working when called immediately after adding items to the list, set this setting to true. | |
float | dragThreshold = float.NaN |
Distance the pointer must travel beyond which when it is released, the item under the pointer will not be considered to have been selected. This allows touch scrolling without inadvertently selecting the item under the pointer. | |
GameObject[] | sceneItems = new GameObject[0] |
Optional array of items in the scene that are to be added to the list on startup. These will be added before the items in the prefabItems array. | |
PrefabListItem[] | prefabItems = new PrefabListItem[0] |
Optional array of item prefabs that are to be added to the list on startup. These will be added after the items in the sceneItems array. | |
MonoBehaviour | scriptWithMethodToInvoke |
Reference to the script component with the method you wish to invoke when an item is selected. | |
string | methodToInvokeOnSelect |
A string containing the name of the method to be invoked when an item is selected. | |
SpriteManager | manager |
(Optional) Manager to which instantiated list items should be added once created. If none is set, sprites must either be unmanaged, or must already have been added to a manager. | |
bool | detargetOnDisable = false |
When set to true, the control will instruct any pointers which have it as their target to de-target them. Use this if you are deactivating a control and want no input to go to it. It is strongly recommended NOT to use this feature on any control that appears in a scroll list, or else you may be unable to scroll past the edge of the list's viewable area. | |
EZAnimation.EASING_TYPE | positionEasing = EZAnimation.EASING_TYPE.ExponentialOut |
The easing to use to reposition items in the list when items are inserted to, or removed from, the list. | |
float | positionEaseDuration = 0.5f |
The duration of the position easing, in seconds. | |
float | positionEaseDelay = 0 |
The delay of the position easing, in seconds. | |
bool | blockInputWhileEasing = true |
Indicates whether or not input should be blocked while items are easing into place. It is recommended to leave this at the default value of true. | |
bool | repositionOnEnable = true |
When true, the content of the list will be re-laid out whenever the list object becomes active (enabled). | |
Properties | |
float | ScrollPosition [get, set] |
Sets or retrieves the scroll position of the list. The position is given as a value between 0 and 1. 0 indicates the beginning of the list, 1 the end. | |
IUIListObject | SnappedItem [get] |
The item to which the list is snapped, or is in the process of snapping. Only gets set when "Snap" is enabled, or when ScrollToItem() is used to scroll directly to a particular item. | |
float | ContentExtents [get] |
The length of the content, from start to end. | |
float | UnviewableArea [get] |
The total size of the portions of the list not able to fit into the viewable area at any given time. | |
IUIListObject | SelectedItem [get, set] |
Accessor that returns a reference to the currently selected item. Null is returned if no item is currently selected. Can also be used to set the currently selected item. | |
IUIObject | LastClickedControl [get] |
The last control to have been clicked. This can be used for easily accessing nested children inside a UIListItemContainer, but can be used for any control that implements IUIObject. | |
int | Count [get] |
Returns the number of items currently in the list. | |
bool | controlIsEnabled [get, set] |
Controls whether this control is in an enabled state or not. If it is not, input is not processed. This can also be used to cause a control to take on a "grayed out" appearance when disabled. | |
virtual bool | DetargetOnDisable [get, set] |
When set to true, the control will instruct any pointers which have it as their target to de-target them. Use this if you are deactivating a control and want no input to go to it. It is strongly recommended NOT to use this feature on any control that appears in a scroll list, or else you may be unable to scroll past the edge of the list's viewable area. | |
object | Data [get, set] |
Holds "boxed" data for the control. This can be used to associate any object or value with the control for later reference and use. | |
bool | IsDraggable [get, set] |
Indicates whether the object can be dragged as part of a drag & drop operation. | |
LayerMask | DropMask [get, set] |
A mask which can be used to make the object only be "droppable" on objects in a certain layer. NOTE: This mask is combined with the camera's mask. | |
float | DragOffset [get, set] |
The distance an object being dragged and dropped should be offset toward the camera to ensure it hovers above other objects and controls in the scene. | |
EZAnimation.EASING_TYPE | CancelDragEasing [get, set] |
The type of easing to use to animate the object back to its starting position when a drag operation is cancelled. | |
float | CancelDragDuration [get, set] |
The duration of the easing animation when a drag and drop operation is cancelled. | |
bool | IsDragging [get, set] |
Indicates whether the object is being dragged as part of a drag & drop operation. Setting this value to false while the object is being dragged will cause the drag and drop operation to be cancelled. | |
GameObject | DropTarget [get, set] |
The GameObject over which the object being dragged is hovering and will attempt to be dropped if it let go. | |
bool | DropHandled [get, set] |
In the context of a drag & drop operation, this indicates whether the drop action was handled. If this is not set to true in response to a Dropped message sent to OnEZDragDrop(), the drop will be considered to be unhandled and will result in a cancelled drop, causing the dragged object to return to its original position. |
Acts as a container of list items (basically buttons) and manages them in such a manner as to allow the user to scroll through the list. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
Determines how items will be aligned within the list when added.
Determines whether items will be added to the list from top-to-bottom and left-to-right, or from bottom-to-top and right-to-left.
The possible orientations of a scroll list. HORIZONTAL will cause the list items to be side-by-side, and the list will scroll right and left. VERTICAL will cause the list items to be displayed vertically and the list will scroll up and down.
void UIScrollList.AddDragDropDelegate | ( | EZDragDropDelegate | del | ) |
Adds a delegate to be called with drag and drop notifications.
del | The delegate to add. |
Implements IEZDragDrop.
void UIScrollList.AddInputDelegate | ( | EZInputDelegate | del | ) |
void UIScrollList.AddItem | ( | IUIListObject | item, | |
string | text | |||
) |
Adds an item to the end of the list. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
item | Reference to the list item to be added. | |
text | Text to display in the item (requires that the item has a TextMesh associated with it, preferably in a child GameObject). |
void UIScrollList.AddItem | ( | IUIListObject | item | ) |
Adds an item to the end of the list. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
item | Reference to the list item to be added. |
void UIScrollList.AddItem | ( | GameObject | itemGO | ) |
Adds an item to the end of the list. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
item | Reference to a GameObject containing a list item to be added. |
void UIScrollList.AddItemSnappedDelegate | ( | ItemSnappedDelegate | del | ) |
Adds a delegate to be called when the list snaps to an item.
del | Delegate to be called. |
void UIScrollList.AddValueChangedDelegate | ( | EZValueChangedDelegate | del | ) |
Adds a method to be called when the value of a control changes (such as a checkbox changing from false to true, or a slider being moved).
del | A method that conforms to the EZValueChangedDelegate pattern. |
Implements IUIObject.
void UIScrollList.CancelDrag | ( | ) |
Cancels any pending drag and drop operation.
Implements IEZDragDrop.
void UIScrollList.ClearList | ( | bool | destroy | ) |
Empties the contents of the list entirely. Destroys the items if instructed, otherwise it just deactivates them.
destroy | When true, the list items are actually destroyed. Otherwise, they are deactivated. |
static UIScrollList UIScrollList.Create | ( | string | name, | |
Vector3 | pos, | |||
Quaternion | rotation | |||
) | [static] |
Creates a GameObject and attaches this component type to it.
name | Name to give to the new GameObject. | |
pos | Position, in world space, where the new object should be created. | |
rotation | Rotation of the object. |
static UIScrollList UIScrollList.Create | ( | string | name, | |
Vector3 | pos | |||
) | [static] |
Creates a GameObject and attaches this component type to it.
name | Name to give to the new GameObject. | |
pos | Position, in world space, where the new object should be created. |
IUIListObject UIScrollList.CreateItem | ( | GameObject | prefab, | |
int | position, | |||
string | text, | |||
bool | doEasing | |||
) |
Instantiates a new list item based on the prefab to clone, adds it to the list at the position specified by "position" and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
prefab | GameObject/Prefab which is to be instantiated and added to the end of the list. | |
position | 0-based index where the new item will be placed in the list. | |
text | Text to display in the item (requires that the item has a TextMesh associated with it, preferably in a child GameObject). | |
doEasing | Indicates whether easing should be performed to reposition other items in the list when making room for the inserted item. Only applies if the item is being inserted before another item. |
IUIListObject UIScrollList.CreateItem | ( | GameObject | prefab, | |
int | position, | |||
string | text | |||
) |
Instantiates a new list item based on the prefab to clone, adds it to the list at the position specified by "position" and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
prefab | GameObject/Prefab which is to be instantiated and added to the end of the list. | |
position | 0-based index where the new item will be placed in the list. | |
text | Text to display in the item (requires that the item has a TextMesh associated with it, preferably in a child GameObject). |
IUIListObject UIScrollList.CreateItem | ( | GameObject | prefab, | |
int | position | |||
) |
Instantiates a new list item based on the prefab to clone, adds it to the list at the position specified by "position" and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
prefab | GameObject/Prefab which is to be instantiated and added to the end of the list. | |
position | 0-based index where the new item will be placed in the list. |
IUIListObject UIScrollList.CreateItem | ( | GameObject | prefab, | |
int | position, | |||
bool | doEasing | |||
) |
Instantiates a new list item based on the prefab to clone, adds it to the list at the position specified by "position" and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
prefab | GameObject/Prefab which is to be instantiated and added to the end of the list. | |
position | 0-based index where the new item will be placed in the list. | |
doEasing | Indicates whether easing should be performed to reposition other items in the list when making room for the inserted item. Only applies if the item is being inserted before another item. |
IUIListObject UIScrollList.CreateItem | ( | GameObject | prefab, | |
string | text | |||
) |
Instantiates a new list item based on the prefab to clone, adds it to the end of the list and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
prefab | GameObject/Prefab which is to be instantiated and added to the end of the list. | |
text | Text to display in the item (requires that the item has a TextMesh associated with it, preferably in a child GameObject). |
IUIListObject UIScrollList.CreateItem | ( | GameObject | prefab | ) |
Instantiates a new list item based on the prefab to clone, adds it to the end of the list and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
prefab | GameObject/Prefab which is to be instantiated and added to the end of the list. |
IUIListObject UIScrollList.GetItem | ( | int | index | ) |
Returns a reference to the specified list item.
index | Index of the item to retrieve. |
void UIScrollList.InsertItem | ( | IUIListObject | item, | |
int | position, | |||
string | text, | |||
bool | doEasing | |||
) |
Inserts a list item at the specified position in the list.
item | Reference to the item to be inserted into the list. | |
position | 0-based index of the position in the list where the item will be placed. | |
text | Text to display in the item (requires that the item has a TextMesh associated with it, preferably in a child GameObject). | |
doEasing | Indicates whether easing should be performed to reposition other items in the list when making room for the inserted item. Only applies if the item is being inserted before another item. |
void UIScrollList.InsertItem | ( | IUIListObject | item, | |
int | position, | |||
string | text | |||
) |
Inserts a list item at the specified position in the list.
item | Reference to the item to be inserted into the list. | |
position | 0-based index of the position in the list where the item will be placed. | |
text | Text to display in the item (requires that the item has a TextMesh associated with it, preferably in a child GameObject). |
void UIScrollList.InsertItem | ( | IUIListObject | item, | |
int | position, | |||
bool | doEasing | |||
) |
Inserts a list item at the specified position in the list.
item | Reference to the item to be inserted into the list. | |
position | 0-based index of the position in the list where the item will be placed. | |
doEasing | Indicates whether easing should be performed to reposition other items in the list when making room for the inserted item. Only applies if the item is being inserted before another item. |
void UIScrollList.InsertItem | ( | IUIListObject | item, | |
int | position | |||
) |
Inserts a list item at the specified position in the list.
item | Reference to the item to be inserted into the list. | |
position | 0-based index of the position in the list where the item will be placed. |
delegate void UIScrollList.ItemSnappedDelegate | ( | IUIListObject | item | ) |
Delegate definition for a delegate that receives a notification when the list snaps to an item.
item | The item to which the list is snapping |
void UIScrollList.OnInput | ( | POINTER_INFO | ptr | ) |
This is where input handling code should go in any derived class.
ptr | POINTER_INFO struct that contains information on the pointer that caused the event, as well as the event that occurred. |
Implements IUIObject.
void UIScrollList.PositionItems | ( | ) |
Positions list items according to the current scroll position.
void UIScrollList.RemoveDragDropDelegate | ( | EZDragDropDelegate | del | ) |
Removes a delegate from the list of those to be called with drag and drop notifications.
del | The delegate to add. |
Implements IEZDragDrop.
void UIScrollList.RemoveInputDelegate | ( | EZInputDelegate | del | ) |
Removes a method added with AddInputDelegate().
del | A method that conforms to the EZInputDelegate pattern. |
Implements IUIObject.
void UIScrollList.RemoveItem | ( | IUIListObject | item, | |
bool | destroy, | |||
bool | doEasing | |||
) |
Removes the specified item. Remaining items are repositioned to fill the gap. The removed item is destroyed if 'destroy' is true. Otherwise, it is deactivated.
item | Reference to the item to be removed. | |
destroy | Whether or not to destroy the item being removed. | |
doEasing | Indicates whether easing should be performed on the items which will move to fill the void created by removal of this item. Only applies if the item being removed is not at the end of the list. |
void UIScrollList.RemoveItem | ( | IUIListObject | item, | |
bool | destroy | |||
) |
Removes the specified item. Remaining items are repositioned to fill the gap. The removed item is destroyed if 'destroy' is true. Otherwise, it is deactivated.
item | Reference to the item to be removed. | |
destroy | Whether or not to destroy the item being removed. |
void UIScrollList.RemoveItem | ( | int | index, | |
bool | destroy, | |||
bool | doEasing | |||
) |
Removes the item at the specified index. Remaining items are repositioned to fill the gap. The removed item is destroyed if 'destroy' is true. Otherwise, it is deactivated.
index | Index of the item to remove. | |
destroy | Whether or not to destroy the item being removed. | |
doEasing | Indicates whether easing should be performed on the items which will move to fill the void created by removal of this item. Only applies if the item being removed is not at the end of the list. |
void UIScrollList.RemoveItem | ( | int | index, | |
bool | destroy | |||
) |
Removes the item at the specified index. Remaining items are repositioned to fill the gap. The removed item is destroyed if 'destroy' is true. Otherwise, it is deactivated.
index | Index of the item to remove. | |
destroy | Whether or not to destroy the item being removed. |
void UIScrollList.RemoveItemSnappedDelegate | ( | ItemSnappedDelegate | del | ) |
Removes a delegate from the list of those to be called when the list snaps to an item.
del | The delegate to remove. |
void UIScrollList.RemoveValueChangedDelegate | ( | EZValueChangedDelegate | del | ) |
Removes a method added with AddValueChangedDelegate().
del | A method that conforms to the EZValueChangedDelegate pattern. |
Implements IUIObject.
void UIScrollList.RepositionItems | ( | ) |
Repositions list items according to the current scroll position, and adjusts for any change in the items' extents.
void UIScrollList.ScrollListTo | ( | float | pos | ) |
Scrolls the list directly to the position indicated (0-1).
pos | Position of the list - 0-1 (0 == beginning, 1 == end) |
void UIScrollList.ScrollToItem | ( | int | index, | |
float | scrollTime | |||
) |
Scrolls the list to the specified item in the specified number of seconds.
index | The index of the item to scroll to. | |
scrollTime | The number of seconds the scroll should last. |
void UIScrollList.ScrollToItem | ( | IUIListObject | item, | |
float | scrollTime | |||
) |
Scrolls the list to the specified item in the specified number of seconds.
item | The item to scroll to. | |
scrollTime | The number of seconds the scroll should last. |
void UIScrollList.ScrollToItem | ( | int | index, | |
float | scrollTime, | |||
EZAnimation.EASING_TYPE | easing | |||
) |
Scrolls the list to the specified item in the specified number of seconds.
index | The index of the item to scroll to. | |
scrollTime | The number of seconds the scroll should last. | |
easing | The type of easing to be used for the scroll. |
void UIScrollList.ScrollToItem | ( | IUIListObject | item, | |
float | scrollTime, | |||
EZAnimation.EASING_TYPE | easing | |||
) |
Scrolls the list to the specified item in the specified number of seconds.
item | The item to scroll to. | |
scrollTime | The number of seconds the scroll should last. | |
easing | The type of easing to be used for the scroll. |
void UIScrollList.SetDragDropDelegate | ( | EZDragDropDelegate | del | ) |
Sets the delegate to be called with drag and drop notifications. NOTE: This will replace any previously registered delegates.
del | The delegate to add. |
Implements IEZDragDrop.
void UIScrollList.SetInputDelegate | ( | EZInputDelegate | del | ) |
Sets the method to be called when input occurs (input is forwarded from OnInput()). NOTE: This will replace any and all delegates which have been set or added previously. If you are unsure if any delegates are already registered, use AddInputDelegate() instead, or RemoveInputDelegate() to unset a previously registered delegate. Only use this when you are sure you want to replace all previously registered delegates.
del | A method that conforms to the EZInputDelegate pattern. |
Implements IUIObject.
void UIScrollList.SetSelectedItem | ( | int | index | ) |
Sets the item at the specified index as the currently selected item.
index | The zero-based index of the item. |
void UIScrollList.SetValueChangedDelegate | ( | EZValueChangedDelegate | del | ) |
Sets the method to be called when the value of a control changes (such as a checkbox changing from false to true, or a slider being moved). NOTE: This will replace any and all delegates which have been set or added previously. If you are unsure if any delegates are already registered, use AddValueChangedDelegate() instead, or RemoveValueChangedDelegate() to unset a previously registered delegate. Only use this when you are sure you want to replace all previously registered delegates.
del | A method that conforms to the EZValueChangedDelegate pattern. |
Implements IUIObject.
void UIScrollList.SetViewableAreaPixelDimensions | ( | Camera | cam, | |
int | width, | |||
int | height | |||
) |
Sizes the viewable area of the scroll list using pixel dimensions as the unit of measurement.
cam | The camera through which the list will be viewed. | |
width | The width, in pixels, of the list's viewable area. | |
height | The height, in pixels, of the list's viewable area. |
void UIScrollList.UpdateCamera | ( | ) |
Updates any camera-dependent settings, such as the calculated pixel-perfect size. Use this with BroadcastMessage() to do bulk re-calculation of object sizes whenever your screensize/resolution changes at runtime.
bool UIScrollList.activateWhenAdding = true |
When true, items added or inserted to this list will be activated recursively. This is STRONGLY recommended when using managed sprites/controls.
ALIGNMENT UIScrollList.alignment = ALIGNMENT.CENTER |
Determines how the items will be aligned in the list when added. See UIScrollList.ALIGNMENT [ALIGNMENT].
bool UIScrollList.blockInputWhileEasing = true |
Indicates whether or not input should be blocked while items are easing into place. It is recommended to leave this at the default value of true.
bool UIScrollList.clipContents = true |
When true, the contents of the list will be clipped to the viewable area. Otherwise, the content will extend beyond the specified viewable area.
bool UIScrollList.clipWhenMoving = false |
When true, items will be clipped each frame in which it is detected that the list has moved, rotated, or scaled. Use this if you are having clipping errors after scaling, rotating, etc, a list as part of a panel transition, etc. Leave set to false otherwise to improve performance.
bool UIScrollList.detargetOnDisable = false |
When set to true, the control will instruct any pointers which have it as their target to de-target them. Use this if you are deactivating a control and want no input to go to it. It is strongly recommended NOT to use this feature on any control that appears in a scroll list, or else you may be unable to scroll past the edge of the list's viewable area.
DIRECTION UIScrollList.direction = DIRECTION.TtoB_LtoR |
Determines whether items will be added to the list from top-to-bottom and left-to-right, or from bottom-to-top and right-to-left. See UIScrollList.DIRECTION [DIRECTION].
float UIScrollList.dragThreshold = float.NaN |
Distance the pointer must travel beyond which when it is released, the item under the pointer will not be considered to have been selected. This allows touch scrolling without inadvertently selecting the item under the pointer.
float UIScrollList.extraEndSpacing = 0 |
Adds the specified amount of extra space to the ends of the list (before the first item, and after the last). This value is in local units if "unitsInPixels" is false, or in pixels if it is true.
float UIScrollList.itemSpacing |
Empty space to put between each list item.
(Optional) Manager to which instantiated list items should be added once created. If none is set, sprites must either be unmanaged, or must already have been added to a manager.
A string containing the name of the method to be invoked when an item is selected.
float UIScrollList.minSnapDuration = 1f |
The minimum number of seconds a snap should last.
The orientation of the list - horizontal or vertical.
float UIScrollList.positionEaseDelay = 0 |
The delay of the position easing, in seconds.
float UIScrollList.positionEaseDuration = 0.5f |
The duration of the position easing, in seconds.
EZAnimation.EASING_TYPE UIScrollList.positionEasing = EZAnimation.EASING_TYPE.ExponentialOut |
The easing to use to reposition items in the list when items are inserted to, or removed from, the list.
bool UIScrollList.positionItemsImmediately = true |
When set to true, items added to the list will be positioned in the list immediately so that any immediately following code that does something to the list that depends on the new item positioning such as ScrollToItem(), etc, will take the new list contents into account. Otherwise, if left set to false, items are positioned in the list at the end of the frame in which they were added (inside LateUpdate()). If you are adding lots of items to a list in batches, you can save a lot of performance by setting this setting to false so that the items all get positioned in one batch. But if you are having problems with ScrollToItem() or other similar features not working when called immediately after adding items to the list, set this setting to true.
PrefabListItem [] UIScrollList.prefabItems = new PrefabListItem[0] |
Optional array of item prefabs that are to be added to the list on startup. These will be added after the items in the sceneItems array.
Camera UIScrollList.renderCamera |
The camera that will render this list. This needs to be set when unitsInPixels is set to true or when you have prefab items that need to know which camera to use to size themselves.
bool UIScrollList.repositionOnEnable = true |
When true, the content of the list will be re-laid out whenever the list object becomes active (enabled).
GameObject [] UIScrollList.sceneItems = new GameObject[0] |
Optional array of items in the scene that are to be added to the list on startup. These will be added before the items in the prefabItems array.
MonoBehaviour UIScrollList.scriptWithMethodToInvoke |
Reference to the script component with the method you wish to invoke when an item is selected.
float UIScrollList.scrollDecelCoef = 0.04f |
The scroll deceleration coefficient. This value determines how quickly a touch scroll will coast to a stop. When using snapping, this also essentially determines which item will be snapped to when the list is let go. If you want to always scroll one item at a time, for example, set this value high.
float UIScrollList.scrollWheelFactor = 100f |
The factor by which any mouse scrollwheel delta is multiplied to arrive at how far the list should be scrolled in response. To make your list scroll faster or slower in response to mousewheel input, increase or decrease this value, respectively.
An optional slider control that will control the scroll position of the list.
bool UIScrollList.snap = false |
When true, the scroll position will "snap" so that the item nearest the center of the list will snap to the center, provided it wouldn't take us past the edge of the list.
EZAnimation.EASING_TYPE UIScrollList.snapEasing = EZAnimation.EASING_TYPE.ExponentialOut |
The type of easing to use when snapping to an item.
bool UIScrollList.spacingAtEnds = true |
When set to true, the itemSpacing value will be applied before the first item, and after the last so as to "pad" the first and last items a bit from the edge. If false, the first and last items will be flush with the edges of the viewable area.
bool UIScrollList.touchScroll = true |
When true, scrolling will operate like a scrollable list on an iPhone - when a pointing device (normally a finger) is dragged across it, it scrolls and coasts to an eventual stop if not stopped manually.
bool UIScrollList.unitsInPixels = false |
When true, the viewableArea itemSpacing, etc, are interpreted as being specified in screen pixels.
Vector2 UIScrollList.viewableArea |
The extents of the viewable area, in local space units. The contents of the list will be clipped to this area. Ex: If an area of 10x10 is specified, the list contents will be clipped 5 units above the center of the scroll list's GameObject, 5 units below, and 5 units on either side.
float UIScrollList.CancelDragDuration [get, set] |
The duration of the easing animation when a drag and drop operation is cancelled.
Implements IEZDragDrop.
EZAnimation.EASING_TYPE UIScrollList.CancelDragEasing [get, set] |
The type of easing to use to animate the object back to its starting position when a drag operation is cancelled.
Implements IEZDragDrop.
float UIScrollList.ContentExtents [get] |
The length of the content, from start to end.
bool UIScrollList.controlIsEnabled [get, set] |
Controls whether this control is in an enabled state or not. If it is not, input is not processed. This can also be used to cause a control to take on a "grayed out" appearance when disabled.
Implements IUIObject.
int UIScrollList.Count [get] |
Returns the number of items currently in the list.
object UIScrollList.Data [get, set] |
Holds "boxed" data for the control. This can be used to associate any object or value with the control for later reference and use.
Implements IEZDragDrop.
virtual bool UIScrollList.DetargetOnDisable [get, set] |
When set to true, the control will instruct any pointers which have it as their target to de-target them. Use this if you are deactivating a control and want no input to go to it. It is strongly recommended NOT to use this feature on any control that appears in a scroll list, or else you may be unable to scroll past the edge of the list's viewable area.
Implements IUIObject.
float UIScrollList.DragOffset [get, set] |
The distance an object being dragged and dropped should be offset toward the camera to ensure it hovers above other objects and controls in the scene.
Implements IEZDragDrop.
bool UIScrollList.DropHandled [get, set] |
In the context of a drag & drop operation, this indicates whether the drop action was handled. If this is not set to true in response to a Dropped message sent to OnEZDragDrop(), the drop will be considered to be unhandled and will result in a cancelled drop, causing the dragged object to return to its original position.
Implements IEZDragDrop.
LayerMask UIScrollList.DropMask [get, set] |
A mask which can be used to make the object only be "droppable" on objects in a certain layer. NOTE: This mask is combined with the camera's mask.
Implements IEZDragDrop.
GameObject UIScrollList.DropTarget [get, set] |
The GameObject over which the object being dragged is hovering and will attempt to be dropped if it let go.
Implements IEZDragDrop.
bool UIScrollList.IsDraggable [get, set] |
Indicates whether the object can be dragged as part of a drag & drop operation.
Implements IEZDragDrop.
bool UIScrollList.IsDragging [get, set] |
Indicates whether the object is being dragged as part of a drag & drop operation. Setting this value to false while the object is being dragged will cause the drag and drop operation to be cancelled.
Implements IEZDragDrop.
IUIObject UIScrollList.LastClickedControl [get] |
The last control to have been clicked. This can be used for easily accessing nested children inside a UIListItemContainer, but can be used for any control that implements IUIObject.
float UIScrollList.ScrollPosition [get, set] |
Sets or retrieves the scroll position of the list. The position is given as a value between 0 and 1. 0 indicates the beginning of the list, 1 the end.
IUIListObject UIScrollList.SelectedItem [get, set] |
Accessor that returns a reference to the currently selected item. Null is returned if no item is currently selected. Can also be used to set the currently selected item.
IUIListObject UIScrollList.SnappedItem [get] |
The item to which the list is snapped, or is in the process of snapping. Only gets set when "Snap" is enabled, or when ScrollToItem() is used to scroll directly to a particular item.
float UIScrollList.UnviewableArea [get] |
The total size of the portions of the list not able to fit into the viewable area at any given time.