C# Class FairyGUI.GComponent

Component
Inheritance: GObject
Exibir arquivo Open project: fairygui/FairyGUI-unity Class Usage Examples

Protected Properties

Property Type Description
_boundsChanged bool
_margin Margin
_trackBounds bool

Public Methods

Method Description
AddChild ( GObject child ) : GObject

Add a child to the component. It will be at the frontmost position.

AddChildAt ( GObject child, int index ) : GObject

Adds a child to the component at a certain index.

AddController ( FairyGUI.Controller controller ) : void

Adds a controller to the container.

ConstructFromResource ( ) : void
ConstructFromXML ( XML xml ) : void

Method for extensions to override

Dispose ( ) : void
EnsureBoundsCorrect ( ) : void

Make sure the bounds of the component is correct. Bounds of the component is not updated on every changed. For example, you add a new child to the list, children in the list will be rearranged in next frame. If you want to access the correct child position immediatelly, call this function first.

GComponent ( ) : System
GetChild ( string name ) : GObject

Returns a child object with a certain name.

GetChildAt ( int index ) : GObject

Returns a child object at a certain index. If index out of bounds, exception raised.

GetChildInGroup ( FairyGUI.GGroup group, string name ) : GObject

Returns a child object belong to a group with a certain name.

GetChildIndex ( GObject child ) : int

Returns the index of a child within the container, or "-1" if it is not found.

GetChildren ( ) : FairyGUI.GObject[]

Returns a copy of all children with an array.

GetController ( string name ) : FairyGUI.Controller

Returns a controller object with a certain name.

GetControllerAt ( int index ) : FairyGUI.Controller

Returns a controller object at a certain index.

GetFirstChildInView ( ) : int
GetTransition ( string name ) : Transition

Returns a transition object at a certain name.

GetTransitionAt ( int index ) : Transition

Returns a transition object at a certain index.

GetVisibleChild ( string name ) : GObject

Returns a visible child object with a certain name.

InvalidateBatchingState ( bool childChanged ) : void
IsAncestorOf ( GObject obj ) : bool

IsChildInView ( GObject child ) : bool

Test if a child is in view.

RemoveChild ( GObject child ) : GObject

Removes a child from the component. If the object is not a child, nothing happens.

RemoveChild ( GObject child, bool dispose ) : GObject

Removes a child from the component. If the object is not a child, nothing happens.

RemoveChildAt ( int index ) : GObject

Removes a child at a certain index. Children above the child will move down.

RemoveChildAt ( int index, bool dispose ) : GObject

Removes a child at a certain index. Children above the child will move down.

RemoveChildren ( ) : void

Remove all children.

RemoveChildren ( int beginIndex, int endIndex, bool dispose ) : void

Removes a range of children from the container (endIndex included).

RemoveController ( FairyGUI.Controller c ) : void

Removes a controller from the container.

SetBoundsChangedFlag ( ) : void

Notify the component the bounds should recaculate.

SetChildIndex ( GObject child, int index ) : void

Moves a child to a certain index. Children at and after the replaced position move up.

SetChildIndexBefore ( GObject child, int index ) : int

Moves a child to a certain position which is in front of the child previously at given index. 与SetChildIndex不同的是,如果child原来在index的前面,那么child插入的位置是index-1,即保证排在原来占据index的对象的前面。

SwapChildren ( GObject child1, GObject child2 ) : void

Swaps the indexes of two children.

SwapChildrenAt ( int index1, int index2 ) : void

Swaps the indexes of two children.

Protected Methods

Method Description
CreateDisplayObject ( ) : void
GetSnappingPosition ( float &xValue, float &yValue ) : void
HandleGrayedChanged ( ) : void
HandleSizeChanged ( ) : void
OnUpdate ( ) : void
SetBounds ( float ax, float ay, float aw, float ah ) : void
SetupOverflow ( OverflowType overflow ) : void
SetupScroll ( Margin scrollBarMargin, ScrollType scroll, ScrollBarDisplayType scrollBarDisplay, int flags, String vtScrollBarRes, String hzScrollBarRes ) : void
UpdateBounds ( ) : void

Private Methods

Method Description
AdjustRadioGroupDepth ( GObject obj, FairyGUI.Controller c ) : void
ApplyAllControllers ( ) : void
ApplyController ( FairyGUI.Controller c ) : void
BuildNativeDisplayList ( ) : void
ChildSortingOrderChanged ( GObject child, int oldValue, int newValue ) : void
ChildStateChanged ( GObject child ) : void
ConstructFromResource ( List objectPool, int poolIndex ) : void
GetChildById ( string id ) : GObject
GetInsertPosForSortingChild ( GObject target ) : int
UpdateClipRect ( ) : void
_SetChildIndex ( GObject child, int oldIndex, int index ) : int
__addedToStage ( ) : void
__removedFromStage ( ) : void

Method Details

AddChild() public method

Add a child to the component. It will be at the frontmost position.
public AddChild ( GObject child ) : GObject
child GObject A child object
return GObject

AddChildAt() public method

Adds a child to the component at a certain index.
public AddChildAt ( GObject child, int index ) : GObject
child GObject A child object
index int Index
return GObject

AddController() public method

Adds a controller to the container.
public AddController ( FairyGUI.Controller controller ) : void
controller FairyGUI.Controller Controller object
return void

ConstructFromResource() public method

public ConstructFromResource ( ) : void
return void

ConstructFromXML() public method

Method for extensions to override
public ConstructFromXML ( XML xml ) : void
xml FairyGUI.Utils.XML
return void

CreateDisplayObject() protected method

protected CreateDisplayObject ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

EnsureBoundsCorrect() public method

Make sure the bounds of the component is correct. Bounds of the component is not updated on every changed. For example, you add a new child to the list, children in the list will be rearranged in next frame. If you want to access the correct child position immediatelly, call this function first.
public EnsureBoundsCorrect ( ) : void
return void

GComponent() public method

public GComponent ( ) : System
return System

GetChild() public method

Returns a child object with a certain name.
public GetChild ( string name ) : GObject
name string Name
return GObject

GetChildAt() public method

Returns a child object at a certain index. If index out of bounds, exception raised.
public GetChildAt ( int index ) : GObject
index int Index
return GObject

GetChildInGroup() public method

Returns a child object belong to a group with a certain name.
public GetChildInGroup ( FairyGUI.GGroup group, string name ) : GObject
group FairyGUI.GGroup A group object
name string Name
return GObject

GetChildIndex() public method

Returns the index of a child within the container, or "-1" if it is not found.
public GetChildIndex ( GObject child ) : int
child GObject A child object
return int

GetChildren() public method

Returns a copy of all children with an array.
public GetChildren ( ) : FairyGUI.GObject[]
return FairyGUI.GObject[]

GetController() public method

Returns a controller object with a certain name.
public GetController ( string name ) : FairyGUI.Controller
name string Name
return FairyGUI.Controller

GetControllerAt() public method

Returns a controller object at a certain index.
public GetControllerAt ( int index ) : FairyGUI.Controller
index int Index
return FairyGUI.Controller

GetFirstChildInView() public method

public GetFirstChildInView ( ) : int
return int

GetSnappingPosition() protected method

protected GetSnappingPosition ( float &xValue, float &yValue ) : void
xValue float
yValue float
return void

GetTransition() public method

Returns a transition object at a certain name.
public GetTransition ( string name ) : Transition
name string Name
return Transition

GetTransitionAt() public method

Returns a transition object at a certain index.
public GetTransitionAt ( int index ) : Transition
index int Index
return Transition

GetVisibleChild() public method

Returns a visible child object with a certain name.
public GetVisibleChild ( string name ) : GObject
name string Name
return GObject

HandleGrayedChanged() protected method

protected HandleGrayedChanged ( ) : void
return void

HandleSizeChanged() protected method

protected HandleSizeChanged ( ) : void
return void

InvalidateBatchingState() public method

public InvalidateBatchingState ( bool childChanged ) : void
childChanged bool
return void

IsAncestorOf() public method

public IsAncestorOf ( GObject obj ) : bool
obj GObject
return bool

IsChildInView() public method

Test if a child is in view.
public IsChildInView ( GObject child ) : bool
child GObject A child object
return bool

OnUpdate() protected method

protected OnUpdate ( ) : void
return void

RemoveChild() public method

Removes a child from the component. If the object is not a child, nothing happens.
public RemoveChild ( GObject child ) : GObject
child GObject A child object
return GObject

RemoveChild() public method

Removes a child from the component. If the object is not a child, nothing happens.
public RemoveChild ( GObject child, bool dispose ) : GObject
child GObject A child object
dispose bool If true, the child will be disposed right away.
return GObject

RemoveChildAt() public method

Removes a child at a certain index. Children above the child will move down.
public RemoveChildAt ( int index ) : GObject
index int Index
return GObject

RemoveChildAt() public method

Removes a child at a certain index. Children above the child will move down.
public RemoveChildAt ( int index, bool dispose ) : GObject
index int Index
dispose bool If true, the child will be disposed right away.
return GObject

RemoveChildren() public method

Remove all children.
public RemoveChildren ( ) : void
return void

RemoveChildren() public method

Removes a range of children from the container (endIndex included).
public RemoveChildren ( int beginIndex, int endIndex, bool dispose ) : void
beginIndex int Begin index.
endIndex int End index.(Included).
dispose bool If true, the child will be disposed right away.
return void

RemoveController() public method

Removes a controller from the container.
public RemoveController ( FairyGUI.Controller c ) : void
c FairyGUI.Controller Controller object.
return void

SetBounds() protected method

protected SetBounds ( float ax, float ay, float aw, float ah ) : void
ax float
ay float
aw float
ah float
return void

SetBoundsChangedFlag() public method

Notify the component the bounds should recaculate.
public SetBoundsChangedFlag ( ) : void
return void

SetChildIndex() public method

Moves a child to a certain index. Children at and after the replaced position move up.
public SetChildIndex ( GObject child, int index ) : void
child GObject A Child
index int Index
return void

SetChildIndexBefore() public method

Moves a child to a certain position which is in front of the child previously at given index. 与SetChildIndex不同的是,如果child原来在index的前面,那么child插入的位置是index-1,即保证排在原来占据index的对象的前面。
public SetChildIndexBefore ( GObject child, int index ) : int
child GObject
index int
return int

SetupOverflow() protected method

protected SetupOverflow ( OverflowType overflow ) : void
overflow OverflowType
return void

SetupScroll() protected method

protected SetupScroll ( Margin scrollBarMargin, ScrollType scroll, ScrollBarDisplayType scrollBarDisplay, int flags, String vtScrollBarRes, String hzScrollBarRes ) : void
scrollBarMargin Margin
scroll ScrollType
scrollBarDisplay ScrollBarDisplayType
flags int
vtScrollBarRes String
hzScrollBarRes String
return void

SwapChildren() public method

Swaps the indexes of two children.
public SwapChildren ( GObject child1, GObject child2 ) : void
child1 GObject A child object
child2 GObject A child object
return void

SwapChildrenAt() public method

Swaps the indexes of two children.
public SwapChildrenAt ( int index1, int index2 ) : void
index1 int index of first child
index2 int index of second child
return void

UpdateBounds() protected method

protected UpdateBounds ( ) : void
return void

Property Details

_boundsChanged protected_oe property

protected bool _boundsChanged
return bool

_margin protected_oe property

protected Margin,FairyGUI _margin
return Margin

_trackBounds protected_oe property

protected bool _trackBounds
return bool