C# Class UIPanel, LoopScorllViewForNGUI

Inheritance: UIRect
Mostrar archivo Open project: tinyantstudio/LoopScorllViewForNGUI Class Usage Examples

Public Properties

Property Type Description
alwaysOnScreen bool
anchorOffset bool
cullWhileDragging bool
generateNormals bool
list BetterList
onClipMove OnClippingMoved
onGeometryUpdated OnGeometryUpdated
renderQueue RenderQueue
showInPanelTool bool
startingRenderQueue int
widgetsAreStatic bool

Private Properties

Property Type Description
Awake void
FillAllDrawCalls void
FillDrawCall bool
FindParent void
GetWindowSize Vector2
InvalidateClipping void
LateUpdate void
OnDrawGizmos void
RebuildAllDrawCalls void
UpdateDrawCalls void
UpdateLayers void
UpdateSelf void
UpdateTransformMatrix void
UpdateWidgets void

Public Methods

Method Description
AddWidget ( UIWidget, w ) : void

Make the following widget be managed by the panel.

Affects ( UIWidget, w ) : bool

Whether the specified widget is going to be affected by this panel in any way.

CalculateConstrainOffset ( Vector2 min, Vector2 max ) : Vector3

Calculate the offset needed to be constrained within the panel's bounds.

CalculateFinalAlpha ( int frameID ) : float

Widget's final alpha, after taking the panel's alpha into account.

CompareFunc ( UIPanel, a, UIPanel, b ) : int

Function that can be used to depth-sort panels.

ConstrainTargetToBounds ( Transform target, Bounds &targetBounds, bool immediate ) : bool

Constrain the current target position to be within panel bounds.

ConstrainTargetToBounds ( Transform target, bool immediate ) : bool

Constrain the specified target to be within the panel's bounds.

Find ( Transform trans ) : UIPanel,

Find the UIPanel responsible for handling the specified transform.

Find ( Transform trans, bool createIfMissing ) : UIPanel,

Find the UIPanel responsible for handling the specified transform.

Find ( Transform trans, bool createIfMissing, int layer ) : UIPanel,

Find the UIPanel responsible for handling the specified transform.

FindDrawCall ( UIWidget, w ) : UIDrawCall,

Insert the specified widget into one of the existing draw calls if possible. If it's not possible, and a new draw call is required, 'null' is returned because draw call creation is a delayed operation.

GetSides ( Transform relativeTo ) : Vector3[]

Get the sides of the rectangle relative to the specified transform. The order is left, top, right, bottom.

GetViewSize ( ) : Vector2

Panel's size -- which is either the clipping rect, or the screen dimensions.

Invalidate ( bool includeChildren ) : void

Invalidating the panel should reset its alpha.

IsVisible ( UIWidget, w ) : bool

Returns whether the specified widget is visible by the panel.

IsVisible ( Vector3 worldPos ) : bool

Returns whether the specified world position is within the panel's bounds determined by the clipping rect.

IsVisible ( Vector3 a, Vector3 b, Vector3 c, Vector3 d ) : bool

Returns whether the specified rectangle is visible by the panel. The coordinates must be in world space.

ParentHasChanged ( ) : void

Find the parent panel, if we have one.

Refresh ( ) : void

Immediately refresh the panel.

RemoveWidget ( UIWidget w ) : void

Remove the widget from its current draw call, invalidating everything as needed.

SetDirty ( ) : void

Invalidate the panel's draw calls, forcing them to be rebuilt on the next update. This call also affects all children.

SetRect ( float x, float y, float width, float height ) : void

Set the panel's rectangle.

SortWidgets ( ) : void

Immediately sort all child widgets.

Protected Methods

Method Description
OnAnchor ( ) : void

Update the edges after the anchors have been updated.

OnDisable ( ) : void

Destroy all draw calls we've created when this script gets disabled.

OnEnable ( ) : void

Reset the frame IDs.

OnInit ( ) : void

Mark all widgets as having been changed so the draw calls get re-created.

OnStart ( ) : void

Layer is used to ensure that if it changes, widgets get moved as well.

Private Methods

Method Description
Awake ( ) : void

Cache components.

FillAllDrawCalls ( ) : void

Fill the geometry fully, processing all widgets and re-creating all draw calls.

FillDrawCall ( UIDrawCall, dc ) : bool

Fill the geometry for the specified draw call.

FindParent ( ) : void

Find the parent panel, if we have one.

GetWindowSize ( ) : Vector2

Get the size of the game window in pixels.

InvalidateClipping ( ) : void

Invalidate the panel's clipping, calling child panels in turn.

LateUpdate ( ) : void

Update all panels and draw calls.

OnDrawGizmos ( ) : void

Draw a visible pink outline for the clipped area.

RebuildAllDrawCalls ( ) : void
UpdateDrawCalls ( ) : void

Update all draw calls associated with the panel.

UpdateLayers ( ) : void

Update the widget layers if the panel's layer has changed.

UpdateSelf ( ) : void

Update the panel, all of its widgets and draw calls.

UpdateTransformMatrix ( ) : void

Update the world-to-local transform matrix as well as clipping bounds.

UpdateWidgets ( ) : void

Update all of the widgets belonging to this panel.

Method Details

AddWidget() public method

Make the following widget be managed by the panel.
public AddWidget ( UIWidget, w ) : void
w UIWidget,
return void

Affects() public method

Whether the specified widget is going to be affected by this panel in any way.
public Affects ( UIWidget, w ) : bool
w UIWidget,
return bool

CalculateConstrainOffset() public method

Calculate the offset needed to be constrained within the panel's bounds.
public CalculateConstrainOffset ( Vector2 min, Vector2 max ) : Vector3
min Vector2
max Vector2
return Vector3

CalculateFinalAlpha() public method

Widget's final alpha, after taking the panel's alpha into account.
public CalculateFinalAlpha ( int frameID ) : float
frameID int
return float

CompareFunc() static public method

Function that can be used to depth-sort panels.
static public CompareFunc ( UIPanel, a, UIPanel, b ) : int
a UIPanel,
b UIPanel,
return int

ConstrainTargetToBounds() public method

Constrain the current target position to be within panel bounds.
public ConstrainTargetToBounds ( Transform target, Bounds &targetBounds, bool immediate ) : bool
target Transform
targetBounds Bounds
immediate bool
return bool

ConstrainTargetToBounds() public method

Constrain the specified target to be within the panel's bounds.
public ConstrainTargetToBounds ( Transform target, bool immediate ) : bool
target Transform
immediate bool
return bool

Find() static public method

Find the UIPanel responsible for handling the specified transform.
static public Find ( Transform trans ) : UIPanel,
trans Transform
return UIPanel,

Find() static public method

Find the UIPanel responsible for handling the specified transform.
static public Find ( Transform trans, bool createIfMissing ) : UIPanel,
trans Transform
createIfMissing bool
return UIPanel,

Find() static public method

Find the UIPanel responsible for handling the specified transform.
static public Find ( Transform trans, bool createIfMissing, int layer ) : UIPanel,
trans Transform
createIfMissing bool
layer int
return UIPanel,

FindDrawCall() public method

Insert the specified widget into one of the existing draw calls if possible. If it's not possible, and a new draw call is required, 'null' is returned because draw call creation is a delayed operation.
public FindDrawCall ( UIWidget, w ) : UIDrawCall,
w UIWidget,
return UIDrawCall,

GetSides() public method

Get the sides of the rectangle relative to the specified transform. The order is left, top, right, bottom.
public GetSides ( Transform relativeTo ) : Vector3[]
relativeTo Transform
return Vector3[]

GetViewSize() public method

Panel's size -- which is either the clipping rect, or the screen dimensions.
public GetViewSize ( ) : Vector2
return Vector2

Invalidate() public method

Invalidating the panel should reset its alpha.
public Invalidate ( bool includeChildren ) : void
includeChildren bool
return void

IsVisible() public method

Returns whether the specified widget is visible by the panel.
public IsVisible ( UIWidget, w ) : bool
w UIWidget,
return bool

IsVisible() public method

Returns whether the specified world position is within the panel's bounds determined by the clipping rect.
public IsVisible ( Vector3 worldPos ) : bool
worldPos Vector3
return bool

IsVisible() public method

Returns whether the specified rectangle is visible by the panel. The coordinates must be in world space.
public IsVisible ( Vector3 a, Vector3 b, Vector3 c, Vector3 d ) : bool
a Vector3
b Vector3
c Vector3
d Vector3
return bool

OnAnchor() protected method

Update the edges after the anchors have been updated.
protected OnAnchor ( ) : void
return void

OnDisable() protected method

Destroy all draw calls we've created when this script gets disabled.
protected OnDisable ( ) : void
return void

OnEnable() protected method

Reset the frame IDs.
protected OnEnable ( ) : void
return void

OnInit() protected method

Mark all widgets as having been changed so the draw calls get re-created.
protected OnInit ( ) : void
return void

OnStart() protected method

Layer is used to ensure that if it changes, widgets get moved as well.
protected OnStart ( ) : void
return void

ParentHasChanged() public method

Find the parent panel, if we have one.
public ParentHasChanged ( ) : void
return void

Refresh() public method

Immediately refresh the panel.
public Refresh ( ) : void
return void

RemoveWidget() public method

Remove the widget from its current draw call, invalidating everything as needed.
public RemoveWidget ( UIWidget w ) : void
w UIWidget
return void

SetDirty() public method

Invalidate the panel's draw calls, forcing them to be rebuilt on the next update. This call also affects all children.
public SetDirty ( ) : void
return void

SetRect() public method

Set the panel's rectangle.
public SetRect ( float x, float y, float width, float height ) : void
x float
y float
width float
height float
return void

SortWidgets() public method

Immediately sort all child widgets.
public SortWidgets ( ) : void
return void

Property Details

alwaysOnScreen public_oe property

Optimization flag. Makes the assumption that the panel's geometry will always be on screen and the bounds don't need to be re-calculated.
public bool alwaysOnScreen
return bool

anchorOffset public_oe property

By default, non-clipped panels use the camera's bounds, and the panel's position has no effect. If you want the panel's position to actually be used with anchors, set this field to 'true'.
public bool anchorOffset
return bool

cullWhileDragging public_oe property

Whether widgets will be culled while the panel is being dragged. Having this on improves performance, but turning it off will reduce garbage collection.
public bool cullWhileDragging
return bool

generateNormals public_oe property

Whether normals and tangents will be generated for all meshes
public bool generateNormals
return bool

list static_oe public_oe property

List of active panels.
static public BetterList list
return BetterList

onClipMove public_oe property

Event callback that's triggered when the panel's clip region gets moved.
public OnClippingMoved onClipMove
return OnClippingMoved

onGeometryUpdated public_oe property

Notification triggered when the panel's geometry get rebuilt. It's mainly here for debugging purposes.
public OnGeometryUpdated onGeometryUpdated
return OnGeometryUpdated

renderQueue public_oe property

By default all panels manage render queues of their draw calls themselves by incrementing them so that the geometry is drawn in the proper order. You can alter this behaviour.
public RenderQueue renderQueue
return RenderQueue

showInPanelTool public_oe property

Whether this panel will show up in the panel tool (set this to 'false' for dynamically created temporary panels)
public bool showInPanelTool
return bool

startingRenderQueue public_oe property

Render queue used by the panel. The default value of '3000' is the equivalent of "Transparent". This property is only used if 'renderQueue' is set to something other than "Automatic".
public int startingRenderQueue
return int

widgetsAreStatic public_oe property

Whether widgets drawn by this panel are static (won't move). This will improve performance.
public bool widgetsAreStatic
return bool