C# Class FairyGUI.GComponent

Component
Inheritance: GObject
Afficher le fichier Open project: fairygui/FairyGUI-unity Class Usage Examples

Protected Properties

Свойство Type Description
_boundsChanged bool
_margin Margin
_trackBounds bool

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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

Méthode 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 méthode

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

AddChildAt() public méthode

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
Résultat GObject

AddController() public méthode

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

ConstructFromResource() public méthode

public ConstructFromResource ( ) : void
Résultat void

ConstructFromXML() public méthode

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

CreateDisplayObject() protected méthode

protected CreateDisplayObject ( ) : void
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

EnsureBoundsCorrect() public méthode

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
Résultat void

GComponent() public méthode

public GComponent ( ) : System
Résultat System

GetChild() public méthode

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

GetChildAt() public méthode

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

GetChildInGroup() public méthode

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
Résultat GObject

GetChildIndex() public méthode

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
Résultat int

GetChildren() public méthode

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

GetController() public méthode

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

GetControllerAt() public méthode

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

GetFirstChildInView() public méthode

public GetFirstChildInView ( ) : int
Résultat int

GetSnappingPosition() protected méthode

protected GetSnappingPosition ( float &xValue, float &yValue ) : void
xValue float
yValue float
Résultat void

GetTransition() public méthode

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

GetTransitionAt() public méthode

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

GetVisibleChild() public méthode

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

HandleGrayedChanged() protected méthode

protected HandleGrayedChanged ( ) : void
Résultat void

HandleSizeChanged() protected méthode

protected HandleSizeChanged ( ) : void
Résultat void

InvalidateBatchingState() public méthode

public InvalidateBatchingState ( bool childChanged ) : void
childChanged bool
Résultat void

IsAncestorOf() public méthode

public IsAncestorOf ( GObject obj ) : bool
obj GObject
Résultat bool

IsChildInView() public méthode

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

OnUpdate() protected méthode

protected OnUpdate ( ) : void
Résultat void

RemoveChild() public méthode

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
Résultat GObject

RemoveChild() public méthode

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.
Résultat GObject

RemoveChildAt() public méthode

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

RemoveChildAt() public méthode

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.
Résultat GObject

RemoveChildren() public méthode

Remove all children.
public RemoveChildren ( ) : void
Résultat void

RemoveChildren() public méthode

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.
Résultat void

RemoveController() public méthode

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

SetBounds() protected méthode

protected SetBounds ( float ax, float ay, float aw, float ah ) : void
ax float
ay float
aw float
ah float
Résultat void

SetBoundsChangedFlag() public méthode

Notify the component the bounds should recaculate.
public SetBoundsChangedFlag ( ) : void
Résultat void

SetChildIndex() public méthode

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
Résultat void

SetChildIndexBefore() public méthode

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
Résultat int

SetupOverflow() protected méthode

protected SetupOverflow ( OverflowType overflow ) : void
overflow OverflowType
Résultat void

SetupScroll() protected méthode

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
Résultat void

SwapChildren() public méthode

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

SwapChildrenAt() public méthode

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
Résultat void

UpdateBounds() protected méthode

protected UpdateBounds ( ) : void
Résultat void

Property Details

_boundsChanged protected_oe property

protected bool _boundsChanged
Résultat bool

_margin protected_oe property

protected Margin,FairyGUI _margin
Résultat Margin

_trackBounds protected_oe property

protected bool _trackBounds
Résultat bool