C# Class FairyGUI.GObject

Inheritance: EventDispatcher
Show file Open project: fairygui/FairyGUI-unity Class Usage Examples

Public Properties

Property Type Description
data object
dragBounds Rect?
group FairyGUI.GGroup
name string

Protected Properties

Property Type Description
_sizeImplType int
underConstruct bool

Private Properties

Property Type Description
DragBegin void
DragEnd void
InitDrag void
InternalSetParent void
Reset void
UpdateGearFromRelations void
__rollOut void
__rollOver void
__touchBegin void
__touchEnd void
__touchEnd2 void
__touchMove void
__touchMove2 void

Public Methods

Method Description
AddRelation ( GObject target, RelationType relationType ) : void

AddRelation ( GObject target, RelationType relationType, bool usePercent ) : void

Center ( ) : void

Set the object in middle of the parent or GRoot if the parent is not set.

Center ( bool restraint ) : void

Set the object in middle of the parent or GRoot if the parent is not set.

ConstructFromResource ( ) : void
Dispose ( ) : void
GObject ( ) : System.Collections.Generic
GetGear ( int index ) : GearBase
GlobalToLocal ( Rect rect ) : Rect

GlobalToLocal ( Vector2 pt ) : Vector2

Transforms a point from global (Stage) coordinates to the local coordinate system.

HandleControllerChanged ( FairyGUI.Controller c ) : void
InvalidateBatchingState ( ) : void

Mark the fairy batching state is invalid.

LocalToGlobal ( Rect rect ) : Rect

LocalToGlobal ( Vector2 pt ) : Vector2

Transforms a point from the local coordinate system to global (Stage) coordinates.

LocalToRoot ( Vector2 pt, GRoot r ) : Vector2

Transforms a point from the local coordinate system to GRoot coordinates.

RemoveFromParent ( ) : void

RemoveRelation ( GObject target, RelationType relationType ) : void

RequestFocus ( ) : void

Request focus on this object.

RootToLocal ( Vector2 pt, GRoot r ) : Vector2

Transforms a point from the GRoot coordinate to local coordinates system.

SetHome ( GObject obj ) : void

SetPivot ( float xv, float yv ) : void

Change the x and y coordinates of the object's origin in its own coordinate space.

SetPivot ( float xv, float yv, bool asAnchor ) : void

Change the x and y coordinates of the object's origin in its own coordinate space.

SetPosition ( float xv, float yv, float zv ) : void

change the x,y,z coordinates of the object relative to the local coordinates of the parent.

SetScale ( float wv, float hv ) : void

Change the scale factor.

SetSize ( float wv, float hv ) : void

Change size.

SetSize ( float wv, float hv, bool ignorePivot ) : void

Change size.

SetXY ( float xv, float yv ) : void

change the x and y coordinates of the object relative to the local coordinates of the parent.

Setup_AfterAdd ( XML xml ) : void
Setup_BeforeAdd ( XML xml ) : void
StartDrag ( ) : void

StartDrag ( int touchId ) : void

StopDrag ( ) : void

TransformPoint ( Vector2 pt, GObject targetSpace ) : Vector2

TransformRect ( Rect rect, GObject targetSpace ) : Rect

TweenFade ( float endValue, float duration ) : Tweener
TweenMove ( Vector2 endValue, float duration ) : Tweener
TweenMoveX ( float endValue, float duration ) : Tweener
TweenMoveY ( float endValue, float duration ) : Tweener
TweenResize ( Vector2 endValue, float duration ) : Tweener
TweenRotate ( float endValue, float duration ) : Tweener
TweenScale ( Vector2 endValue, float duration ) : Tweener
TweenScaleX ( float endValue, float duration ) : Tweener
TweenScaleY ( float endValue, float duration ) : Tweener
WorldToLocal ( Vector3 pt ) : Vector2

WorldToLocal ( Vector3 pt, Camera camera ) : Vector2

Protected Methods

Method Description
CreateDisplayObject ( ) : void
HandleGrayedChanged ( ) : void
HandlePositionChanged ( ) : void
HandleScaleChanged ( ) : void
HandleSizeChanged ( ) : void
SetSizeDirectly ( float wv, float hv ) : void
UpdateAlpha ( ) : void
UpdateGear ( int index ) : void

Private Methods

Method Description
DragBegin ( int touchId ) : void
DragEnd ( ) : void
InitDrag ( ) : void
InternalSetParent ( GComponent value ) : void
Reset ( ) : void
UpdateGearFromRelations ( int index, float dx, float dy ) : void
__rollOut ( ) : void
__rollOver ( ) : void
__touchBegin ( EventContext context ) : void
__touchEnd ( EventContext context ) : void
__touchEnd2 ( EventContext context ) : void
__touchMove ( EventContext context ) : void
__touchMove2 ( EventContext context ) : void

Method Details

AddRelation() public method

public AddRelation ( GObject target, RelationType relationType ) : void
target GObject
relationType RelationType
return void

AddRelation() public method

public AddRelation ( GObject target, RelationType relationType, bool usePercent ) : void
target GObject
relationType RelationType
usePercent bool
return void

Center() public method

Set the object in middle of the parent or GRoot if the parent is not set.
public Center ( ) : void
return void

Center() public method

Set the object in middle of the parent or GRoot if the parent is not set.
public Center ( bool restraint ) : void
restraint bool Add relations to maintain the center state.
return void

ConstructFromResource() public method

public ConstructFromResource ( ) : void
return void

CreateDisplayObject() protected method

protected CreateDisplayObject ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

GObject() public method

public GObject ( ) : System.Collections.Generic
return System.Collections.Generic

GetGear() public method

public GetGear ( int index ) : GearBase
index int
return GearBase

GlobalToLocal() public method

public GlobalToLocal ( Rect rect ) : Rect
rect UnityEngine.Rect
return UnityEngine.Rect

GlobalToLocal() public method

Transforms a point from global (Stage) coordinates to the local coordinate system.
public GlobalToLocal ( Vector2 pt ) : Vector2
pt UnityEngine.Vector2
return UnityEngine.Vector2

HandleControllerChanged() public method

public HandleControllerChanged ( FairyGUI.Controller c ) : void
c FairyGUI.Controller
return void

HandleGrayedChanged() protected method

protected HandleGrayedChanged ( ) : void
return void

HandlePositionChanged() protected method

protected HandlePositionChanged ( ) : void
return void

HandleScaleChanged() protected method

protected HandleScaleChanged ( ) : void
return void

HandleSizeChanged() protected method

protected HandleSizeChanged ( ) : void
return void

InvalidateBatchingState() public method

Mark the fairy batching state is invalid.
public InvalidateBatchingState ( ) : void
return void

LocalToGlobal() public method

public LocalToGlobal ( Rect rect ) : Rect
rect UnityEngine.Rect
return UnityEngine.Rect

LocalToGlobal() public method

Transforms a point from the local coordinate system to global (Stage) coordinates.
public LocalToGlobal ( Vector2 pt ) : Vector2
pt UnityEngine.Vector2
return UnityEngine.Vector2

LocalToRoot() public method

Transforms a point from the local coordinate system to GRoot coordinates.
public LocalToRoot ( Vector2 pt, GRoot r ) : Vector2
pt UnityEngine.Vector2
r GRoot
return UnityEngine.Vector2

RemoveFromParent() public method

public RemoveFromParent ( ) : void
return void

RemoveRelation() public method

public RemoveRelation ( GObject target, RelationType relationType ) : void
target GObject
relationType RelationType
return void

RequestFocus() public method

Request focus on this object.
public RequestFocus ( ) : void
return void

RootToLocal() public method

Transforms a point from the GRoot coordinate to local coordinates system.
public RootToLocal ( Vector2 pt, GRoot r ) : Vector2
pt UnityEngine.Vector2
r GRoot
return UnityEngine.Vector2

SetHome() public method

public SetHome ( GObject obj ) : void
obj GObject
return void

SetPivot() public method

Change the x and y coordinates of the object's origin in its own coordinate space.
public SetPivot ( float xv, float yv ) : void
xv float x value in ratio
yv float y value in ratio
return void

SetPivot() public method

Change the x and y coordinates of the object's origin in its own coordinate space.
public SetPivot ( float xv, float yv, bool asAnchor ) : void
xv float x value in ratio
yv float y value in ratio
asAnchor bool If use the pivot as the anchor position
return void

SetPosition() public method

change the x,y,z coordinates of the object relative to the local coordinates of the parent.
public SetPosition ( float xv, float yv, float zv ) : void
xv float x value.
yv float y value.
zv float z value.
return void

SetScale() public method

Change the scale factor.
public SetScale ( float wv, float hv ) : void
wv float The horizontal scale factor.
hv float The vertical scale factor
return void

SetSize() public method

Change size.
public SetSize ( float wv, float hv ) : void
wv float Width value.
hv float Height value.
return void

SetSize() public method

Change size.
public SetSize ( float wv, float hv, bool ignorePivot ) : void
wv float Width value.
hv float Height value.
ignorePivot bool If pivot is set, the object's positon will change when its size change. Set ignorePivot=false to keep the position.
return void

SetSizeDirectly() protected method

protected SetSizeDirectly ( float wv, float hv ) : void
wv float
hv float
return void

SetXY() public method

change the x and y coordinates of the object relative to the local coordinates of the parent.
public SetXY ( float xv, float yv ) : void
xv float x value.
yv float y value.
return void

Setup_AfterAdd() public method

public Setup_AfterAdd ( XML xml ) : void
xml FairyGUI.Utils.XML
return void

Setup_BeforeAdd() public method

public Setup_BeforeAdd ( XML xml ) : void
xml FairyGUI.Utils.XML
return void

StartDrag() public method

public StartDrag ( ) : void
return void

StartDrag() public method

public StartDrag ( int touchId ) : void
touchId int
return void

StopDrag() public method

public StopDrag ( ) : void
return void

TransformPoint() public method

public TransformPoint ( Vector2 pt, GObject targetSpace ) : Vector2
pt UnityEngine.Vector2
targetSpace GObject
return UnityEngine.Vector2

TransformRect() public method

public TransformRect ( Rect rect, GObject targetSpace ) : Rect
rect UnityEngine.Rect
targetSpace GObject
return UnityEngine.Rect

TweenFade() public method

public TweenFade ( float endValue, float duration ) : Tweener
endValue float
duration float
return Tweener

TweenMove() public method

public TweenMove ( Vector2 endValue, float duration ) : Tweener
endValue UnityEngine.Vector2
duration float
return Tweener

TweenMoveX() public method

public TweenMoveX ( float endValue, float duration ) : Tweener
endValue float
duration float
return Tweener

TweenMoveY() public method

public TweenMoveY ( float endValue, float duration ) : Tweener
endValue float
duration float
return Tweener

TweenResize() public method

public TweenResize ( Vector2 endValue, float duration ) : Tweener
endValue UnityEngine.Vector2
duration float
return Tweener

TweenRotate() public method

public TweenRotate ( float endValue, float duration ) : Tweener
endValue float
duration float
return Tweener

TweenScale() public method

public TweenScale ( Vector2 endValue, float duration ) : Tweener
endValue UnityEngine.Vector2
duration float
return Tweener

TweenScaleX() public method

public TweenScaleX ( float endValue, float duration ) : Tweener
endValue float
duration float
return Tweener

TweenScaleY() public method

public TweenScaleY ( float endValue, float duration ) : Tweener
endValue float
duration float
return Tweener

UpdateAlpha() protected method

protected UpdateAlpha ( ) : void
return void

UpdateGear() protected method

protected UpdateGear ( int index ) : void
index int
return void

WorldToLocal() public method

public WorldToLocal ( Vector3 pt ) : Vector2
pt UnityEngine.Vector3
return UnityEngine.Vector2

WorldToLocal() public method

public WorldToLocal ( Vector3 pt, Camera camera ) : Vector2
pt UnityEngine.Vector3
camera UnityEngine.Camera
return UnityEngine.Vector2

Property Details

_sizeImplType protected property

protected int _sizeImplType
return int

data public property

User defined data.
public object data
return object

dragBounds public property

Restricted range of dragging.
public Rect? dragBounds
return Rect?

group public property

Group belonging to.
public GGroup,FairyGUI group
return FairyGUI.GGroup

name public property

Name of the object.
public string name
return string

underConstruct protected property

protected bool underConstruct
return bool