FairyGUI.GComponent
class FairyGUI.GComponent
Fields and Properties:
FairyGUI.Container rootContainer
- Description: Root container.
FairyGUI.Container container
- Description: Content container. If the component is not clipped, then container==rootContainer.
FairyGUI.ScrollPane scrollPane
- Description: ScrollPane of the component. If the component is not scrollable, the value is null.
FairyGUI.EventListener onDrop
- Description: Dispatched when an object was dragged and dropped to this component.
bool fairyBatching
- Description: Draw call optimization switch.
bool opaque
- Description: If true, mouse/touch events cannot pass through the empty area of the component. Default is true.
FairyGUI.ChildrenRenderOrder childrenRenderOrder
- Description:
int apexIndex
- Description:
bool tabStopChildren
- Description: If true, children can be navigated by TAB from first to last, and repeat
int numChildren
- Description: The number of children of this component.
List<FairyGUI.Controller> Controllers
- Description: Returns controller list.
- Return: Controller list
List<FairyGUI.Transition> Transitions
- Description: Returns transition list.
- Return: Transition list
UnityEngine.Vector2 clipSoftness
- Description: If clipping softness is set, clipped containers will have soft border effect.
FairyGUI.DisplayObject mask
- Description: The mask of the component.
bool reversedMask
- Description:
string baseUserData
- Description:
float viewWidth
- Description: Viwe port width of the container.
float viewHeight
- Description: View port height of the container.
Constructors:
FairyGUI.GComponent.New()
Methods:
void Dispose()
void InvalidateBatchingState(bool)
- Description:
- Parameter childChanged:
FairyGUI.GObject AddChild(FairyGUI.GObject)
- Description: Add a child to the component. It will be at the frontmost position.
- Parameter child: A child object
- Return: GObject
FairyGUI.GObject AddChildAt(FairyGUI.GObject, int)
- Description: Adds a child to the component at a certain index.
- Parameter child: A child object
- Parameter index: Index
- Return: GObject
FairyGUI.GObject RemoveChild(FairyGUI.GObject)
- Description: Removes a child from the component. If the object is not a child, nothing happens.
- Parameter child: A child object
- Return: GObject
FairyGUI.GObject RemoveChild(FairyGUI.GObject, bool)
- Description: Removes a child from the component. If the object is not a child, nothing happens.
- Parameter child: A child object
- Parameter dispose: If true, the child will be disposed right away.
- Return: GObject
FairyGUI.GObject RemoveChildAt(int)
- Description: Removes a child at a certain index. Children above the child will move down.
- Parameter index: Index
- Return: GObject
FairyGUI.GObject RemoveChildAt(int, bool)
- Description: Removes a child at a certain index. Children above the child will move down.
- Parameter index: Index
- Parameter dispose: If true, the child will be disposed right away.
- Return: GObject
void RemoveChildren()
- Description: Remove all children.
void RemoveChildren(int, int, bool)
- Description: Removes a range of children from the container (endIndex included).
- Parameter beginIndex: Begin index.
- Parameter endIndex: End index.(Included).
- Parameter dispose: If true, the child will be disposed right away.
FairyGUI.GObject GetChildAt(int)
- Description: Returns a child object at a certain index. If index out of bounds, exception raised.
- Parameter index: Index
- Return: A child object.
FairyGUI.GObject TryGetChildAt(int)
FairyGUI.GObject GetChild(string)
- Description: Returns a child object with a certain name.
- Parameter name: Name
- Return: A child object. Null if not found.
FairyGUI.GObject GetChildByPath(string)
FairyGUI.GObject GetVisibleChild(string)
- Description: Returns a visible child object with a certain name.
- Parameter name: Name
- Return: A child object. Null if not found.
FairyGUI.GObject GetChildInGroup(FairyGUI.GGroup, string)
- Description: Returns a child object belong to a group with a certain name.
- Parameter group: A group object
- Parameter name: Name
- Return: A child object. Null if not found.
FairyGUI.GObject[] GetChildren()
- Description: Returns a copy of all children with an array.
- Return: An array contains all children
int GetChildIndex(FairyGUI.GObject)
- Description: Returns the index of a child within the container, or "-1" if it is not found.
- Parameter child: A child object
- Return: Index of the child. -1 If not found.
void SetChildIndex(FairyGUI.GObject, int)
- Description: Moves a child to a certain index. Children at and after the replaced position move up.
- Parameter child: A Child
- Parameter index: Index
int SetChildIndexBefore(FairyGUI.GObject, int)
- Description: Moves a child to a certain position which is in front of the child previously at given index. Unlike SetChildIndex, if the child was originally in front of the index, the child is inserted at index-1, ensuring it is placed in front of the object that originally occupied the index.
- Parameter child:
- Parameter index:
void SwapChildren(FairyGUI.GObject, FairyGUI.GObject)
- Description: Swaps the indexes of two children.
- Parameter child1: A child object
- Parameter child2: A child object
void SwapChildrenAt(int, int)
- Description: Swaps the indexes of two children.
- Parameter index1: index of first child
- Parameter index2: index of second child
bool IsAncestorOf(FairyGUI.GObject)
- Description:
- Parameter obj:
- Return:
void AddController(FairyGUI.Controller)
- Description: Adds a controller to the container.
- Parameter controller: Controller object
FairyGUI.Controller GetControllerAt(int)
- Description: Returns a controller object at a certain index.
- Parameter index: Index
- Return: Controller object.
FairyGUI.Controller GetController(string)
- Description: Returns a controller object with a certain name.
- Parameter name: Name
- Return: Controller object. Null if not found.
void RemoveController(FairyGUI.Controller)
- Description: Removes a controller from the container.
- Parameter c: Controller object.
FairyGUI.Transition GetTransitionAt(int)
- Description: Returns a transition object at a certain index.
- Parameter index: Index
- Return: transition object.
FairyGUI.Transition GetTransition(string)
- Description: Returns a transition object at a certain name.
- Parameter name: Name
- Return: Transition Object
bool IsChildInView(FairyGUI.GObject)
- Description: Test if a child is in view.
- Parameter child: A child object
- Return: True if in view
int GetFirstChildInView()
void HandleControllerChanged(FairyGUI.Controller)
void SetBoundsChangedFlag()
- Description: Notify the component the bounds should recaculate.
void EnsureBoundsCorrect()
- Description: 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.
void GetSnappingPosition(ref float, ref float)
void GetSnappingPositionWithDir(ref float, ref float, float, float)
void ConstructFromResource()
void ConstructFromXML(FairyGUI.Utils.XML)
- Description: Method for extensions to override
- Parameter xml: