跳到主要内容

GObject

命名空间:FairyGUI
源码:Assets/Scripts/UI/GObject.cs (行 7)

public class GObject : EventDispatcher

继承:EventDispatcher → GObject

继承成员​

EventDispatcher

AddCapture, AddEventListener, BroadcastEvent, BubbleEvent, DispatchEvent, RemoveCapture, RemoveEventListener, RemoveEventListeners, hasEventListeners, isDispatching

构造函数​

GObject()​

public GObject();

源码:UI/GObject.cs (行 151)

字段​

data​

public object data;

User defined data.

源码:UI/GObject.cs (行 23)

dragBounds​

public Rect? dragBounds;

Restricted range of dragging.

源码:UI/GObject.cs (行 73)

initHeight​

public int initHeight;

The initial height of the object.

源码:UI/GObject.cs (行 43)

initWidth​

public int initWidth;

The initial width of the object.

源码:UI/GObject.cs (行 38)

maxHeight​

public int maxHeight;

源码:UI/GObject.cs (行 63)

maxWidth​

public int maxWidth;

源码:UI/GObject.cs (行 53)

minHeight​

public int minHeight;

源码:UI/GObject.cs (行 58)

minWidth​

public int minWidth;

源码:UI/GObject.cs (行 48)

name​

public string name;

Name of the object.

源码:UI/GObject.cs (行 18)

packageItem​

public PackageItem packageItem;

源码:UI/GObject.cs (行 93)

sourceHeight​

public int sourceHeight;

The source height of the object.

源码:UI/GObject.cs (行 33)

sourceWidth​

public int sourceWidth;

The source width of the object.

源码:UI/GObject.cs (行 28)

underConstruct​

internal protected bool underConstruct;

源码:UI/GObject.cs (行 139)

方法​

AddRelation(GObject, RelationType)​

public void AddRelation(GObject target, RelationType relationType);
参数类型说明
targetGObject
relationTypeRelationType

源码:UI/GObject.cs (行 1336)

AddRelation(GObject, RelationType, bool)​

public void AddRelation(GObject target, RelationType relationType, bool usePercent);
参数类型说明
targetGObject
relationTypeRelationType
usePercentbool

源码:UI/GObject.cs (行 1347)

Center(bool)​

public virtual void Center(bool restraint);

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

参数类型说明
restraintboolAdd relations to maintain the center state.

源码:UI/GObject.cs (行 455)

Center()​

public void Center();

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

源码:UI/GObject.cs (行 446)

ConstructFromResource()​

virtual public void ConstructFromResource();

源码:UI/GObject.cs (行 1890)

CreateDisplayObject()​

virtual protected void CreateDisplayObject();

源码:UI/GObject.cs (行 1836)

Dispose()​

virtual public void Dispose();

源码:UI/GObject.cs (行 1667)

GetGear(int)​

public GearBase GetGear(int index);
参数类型说明
indexint

源码:UI/GObject.cs (行 1197)

GlobalToLocal(Rect)​

public Rect GlobalToLocal(Rect rect);
参数类型说明
rectRect

源码:UI/GObject.cs (行 1549)

GlobalToLocal(Vector2)​

public Vector2 GlobalToLocal(Vector2 pt);

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

参数类型说明
ptVector2

源码:UI/GObject.cs (行 1516)

HandleAlphaChanged()​

virtual protected void HandleAlphaChanged();

源码:UI/GObject.cs (行 1878)

HandleControllerChanged(Controller)​

virtual public void HandleControllerChanged(Controller c);
参数类型说明
cController

源码:UI/GObject.cs (行 1317)

HandleGrayedChanged()​

virtual protected void HandleGrayedChanged();

源码:UI/GObject.cs (行 1872)

HandlePositionChanged()​

virtual protected void HandlePositionChanged();

源码:UI/GObject.cs (行 1845)

HandleScaleChanged()​

virtual protected void HandleScaleChanged();

源码:UI/GObject.cs (行 1866)

HandleSizeChanged()​

virtual protected void HandleSizeChanged();

源码:UI/GObject.cs (行 1860)

HandleVisibleChanged()​

virtual internal protected void HandleVisibleChanged();

源码:UI/GObject.cs (行 1884)

InvalidateBatchingState()​

public void InvalidateBatchingState();

Mark the fairy batching state is invalid.

源码:UI/GObject.cs (行 1309)

LocalToGlobal(Rect)​

public Rect LocalToGlobal(Rect rect);
参数类型说明
rectRect

源码:UI/GObject.cs (行 1532)

LocalToGlobal(Vector2)​

public Vector2 LocalToGlobal(Vector2 pt);

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

参数类型说明
ptVector2

源码:UI/GObject.cs (行 1501)

LocalToRoot(Vector2, GRoot)​

public Vector2 LocalToRoot(Vector2 pt, GRoot r);

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

参数类型说明
ptVector2
rGRoot

源码:UI/GObject.cs (行 1567)

MakeFullScreen()​

public void MakeFullScreen();

设置对象为全屏大小(逻辑屏幕)。

源码:UI/GObject.cs (行 474)

RemoveFromParent()​

public void RemoveFromParent();

源码:UI/GObject.cs (行 1365)

RemoveRelation(GObject, RelationType)​

public void RemoveRelation(GObject target, RelationType relationType);
参数类型说明
targetGObject
relationTypeRelationType

源码:UI/GObject.cs (行 1357)

RequestFocus()​

public void RequestFocus();

Request focus on this object.

源码:UI/GObject.cs (行 1017)

RequestFocus(bool)​

public void RequestFocus(bool byKey);

Request focus on this object.

参数类型说明
byKeybool

源码:UI/GObject.cs (行 1026)

RootToLocal(Vector2, GRoot)​

public Vector2 RootToLocal(Vector2 pt, GRoot r);

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

参数类型说明
ptVector2
rGRoot

源码:UI/GObject.cs (行 1587)

SetHome(GObject)​

public void SetHome(GObject obj);
参数类型说明
objGObject

源码:UI/GObject.cs (行 1122)

SetPivot(float, float)​

public void SetPivot(float xv, float yv);

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

参数类型说明
xvfloatx value in ratio
yvfloaty value in ratio

源码:UI/GObject.cs (行 766)

SetPivot(float, float, bool)​

public void SetPivot(float xv, float yv, bool asAnchor);

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

参数类型说明
xvfloatx value in ratio
yvfloaty value in ratio
asAnchorboolIf use the pivot as the anchor position

源码:UI/GObject.cs (行 777)

SetPosition(float, float, float)​

public void SetPosition(float xv, float yv, float zv);

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

参数类型说明
xvfloatx value.
yvfloaty value.
zvfloatz value.

源码:UI/GObject.cs (行 406)

SetScale(float, float)​

public void SetScale(float wv, float hv);

Change the scale factor.

参数类型说明
wvfloatThe horizontal scale factor.
hvfloatThe vertical scale factor

源码:UI/GObject.cs (行 687)

SetSize(float, float)​

public void SetSize(float wv, float hv);

Change size.

参数类型说明
wvfloatWidth value.
hvfloatHeight value.

源码:UI/GObject.cs (行 539)

SetSize(float, float, bool)​

public void SetSize(float wv, float hv, bool ignorePivot);

Change size.

参数类型说明
wvfloatWidth value.
hvfloatHeight value.
ignorePivotboolIf pivot is set, the object's positon will change when its size change. Set ignorePivot=true to keep the position.

源码:UI/GObject.cs (行 550)

SetSizeDirectly(float, float)​

protected void SetSizeDirectly(float wv, float hv);
参数类型说明
wvfloat
hvfloat

源码:UI/GObject.cs (行 601)

SetXY(float, float)​

public void SetXY(float xv, float yv);

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

参数类型说明
xvfloatx value.
yvfloaty value.

源码:UI/GObject.cs (行 381)

SetXY(float, float, bool)​

public void SetXY(float xv, float yv, bool topLeftValue);
参数类型说明
xvfloat
yvfloat
topLeftValuebool

源码:UI/GObject.cs (行 392)

Setup_AfterAdd(ByteBuffer, int)​

virtual public void Setup_AfterAdd(ByteBuffer buffer, int beginPos);
参数类型说明
bufferByteBuffer
beginPosint

源码:UI/GObject.cs (行 1974)

Setup_BeforeAdd(ByteBuffer, int)​

virtual public void Setup_BeforeAdd(ByteBuffer buffer, int beginPos);
参数类型说明
bufferByteBuffer
beginPosint

源码:UI/GObject.cs (行 1894)

StartDrag()​

public void StartDrag();

源码:UI/GObject.cs (行 1455)

StartDrag(int)​

public void StartDrag(int touchId);
参数类型说明
touchIdint

源码:UI/GObject.cs (行 1464)

StopDrag()​

public void StopDrag();

源码:UI/GObject.cs (行 1475)

TransformPoint(Vector2, GObject)​

public Vector2 TransformPoint(Vector2 pt, GObject targetSpace);
参数类型说明
ptVector2
targetSpaceGObject

源码:UI/GObject.cs (行 1630)

TransformRect(Rect, GObject)​

public Rect TransformRect(Rect rect, GObject targetSpace);
参数类型说明
rectRect
targetSpaceGObject

源码:UI/GObject.cs (行 1646)

TweenFade(float, float)​

public GTweener TweenFade(float endValue, float duration);
参数类型说明
endValuefloat
durationfloat

源码:UI/GObject.cs (行 2176)

TweenMove(Vector2, float)​

public GTweener TweenMove(Vector2 endValue, float duration);
参数类型说明
endValueVector2
durationfloat

源码:UI/GObject.cs (行 2141)

TweenMoveX(float, float)​

public GTweener TweenMoveX(float endValue, float duration);
参数类型说明
endValuefloat
durationfloat

源码:UI/GObject.cs (行 2146)

TweenMoveY(float, float)​

public GTweener TweenMoveY(float endValue, float duration);
参数类型说明
endValuefloat
durationfloat

源码:UI/GObject.cs (行 2151)

TweenResize(Vector2, float)​

public GTweener TweenResize(Vector2 endValue, float duration);
参数类型说明
endValueVector2
durationfloat

源码:UI/GObject.cs (行 2171)

TweenRotate(float, float)​

public GTweener TweenRotate(float endValue, float duration);
参数类型说明
endValuefloat
durationfloat

源码:UI/GObject.cs (行 2181)

TweenScale(Vector2, float)​

public GTweener TweenScale(Vector2 endValue, float duration);
参数类型说明
endValueVector2
durationfloat

源码:UI/GObject.cs (行 2156)

TweenScaleX(float, float)​

public GTweener TweenScaleX(float endValue, float duration);
参数类型说明
endValuefloat
durationfloat

源码:UI/GObject.cs (行 2161)

TweenScaleY(float, float)​

public GTweener TweenScaleY(float endValue, float duration);
参数类型说明
endValuefloat
durationfloat

源码:UI/GObject.cs (行 2166)

UpdateGear(int)​

protected void UpdateGear(int index);
参数类型说明
indexint

源码:UI/GObject.cs (行 1242)

WorldToLocal(Vector3)​

public Vector2 WorldToLocal(Vector3 pt);
参数类型说明
ptVector3

源码:UI/GObject.cs (行 1605)

WorldToLocal(Vector3, Camera)​

public Vector2 WorldToLocal(Vector3 pt, Camera camera);
参数类型说明
ptVector3
cameraCamera

源码:UI/GObject.cs (行 1616)

属性​

actualHeight​

public float actualHeight { get; }

actualHeight = height * scaleY

源码:UI/GObject.cs (行 529)

actualWidth​

public float actualWidth { get; }

actualWidth = width * scalex

源码:UI/GObject.cs (行 521)

alpha​

public float alpha { get; set; }

The opacity of the object. 0 = transparent, 1 = opaque.

源码:UI/GObject.cs (行 903)

asButton​

public GButton asButton { get; }

源码:UI/GObject.cs (行 1711)

asCom​

public GComponent asCom { get; }

源码:UI/GObject.cs (行 1703)

asComboBox​

public GComboBox asComboBox { get; }

源码:UI/GObject.cs (行 1743)

asGraph​

public GGraph asGraph { get; }

源码:UI/GObject.cs (行 1799)

asGroup​

public GGroup asGroup { get; }

源码:UI/GObject.cs (行 1807)

asImage​

public GImage asImage { get; }

源码:UI/GObject.cs (行 1695)

asLabel​

public GLabel asLabel { get; }

源码:UI/GObject.cs (行 1719)

asList​

public GList asList { get; }

源码:UI/GObject.cs (行 1791)

asLoader​

public GLoader asLoader { get; }

源码:UI/GObject.cs (行 1775)

asLoader3D​

public GLoader3D asLoader3D { get; }

源码:UI/GObject.cs (行 1783)

asMovieClip​

public GMovieClip asMovieClip { get; }

源码:UI/GObject.cs (行 1815)

asProgress​

public GProgressBar asProgress { get; }

源码:UI/GObject.cs (行 1727)

asRichTextField​

public GRichTextField asRichTextField { get; }

源码:UI/GObject.cs (行 1759)

asSlider​

public GSlider asSlider { get; }

源码:UI/GObject.cs (行 1735)

asTextField​

public GTextField asTextField { get; }

源码:UI/GObject.cs (行 1751)

asTextInput​

public GTextInput asTextInput { get; }

源码:UI/GObject.cs (行 1767)

asTree​

public GTree asTree { get; }

源码:UI/GObject.cs (行 1823)

blendMode​

virtual public BlendMode blendMode { get; set; }

源码:UI/GObject.cs (行 1092)

cursor​

public string cursor { get; set; }

源码:UI/GObject.cs (行 1060)

displayObject​

public DisplayObject displayObject { get; protected set; }

Lowlevel display object.

源码:UI/GObject.cs (行 83)

dragStartPos​

public Vector2 dragStartPos { get; }

源码:UI/GObject.cs (行 1491)

draggable​

public bool draggable { get; set; }

源码:UI/GObject.cs (行 1439)

dragging​

public bool dragging { get; }

源码:UI/GObject.cs (行 1483)

draggingObject​

public static GObject draggingObject { get; private set; }

当前全局正在被拖动的对象

源码:UI/GObject.cs (行 88)

enabled​

public bool enabled { get; set; }

Enabled is shortcut for grayed and !touchable combination.

源码:UI/GObject.cs (行 835)

filter​

virtual public IFilter filter { get; set; }

源码:UI/GObject.cs (行 1083)

focusable​

public bool focusable { get; set; }

If the object can be focused?

源码:UI/GObject.cs (行 991)

focused​

public bool focused { get; }

If the object is focused.

源码:UI/GObject.cs (行 1009)

gameObjectName​

public string gameObjectName { get; set; }

设定GameObject的名称

源码:UI/GObject.cs (行 1101)

gearLook​

public GearLook gearLook { get; }

Gear to look controller.

源码:UI/GObject.cs (行 1189)

gearSize​

public GearSize gearSize { get; }

Gear to size controller.

源码:UI/GObject.cs (行 1178)

gearXY​

public GearXY gearXY { get; }

Gear to xy controller.

源码:UI/GObject.cs (行 1167)

grayed​

public bool grayed { get; set; }

If true, apply a grayed effect on this object.

源码:UI/GObject.cs (行 815)

group​

public GGroup group { get; set; }

Group belonging to.

源码:UI/GObject.cs (行 1374)

height​

public float height { get; set; }

The height of the object in pixels.

源码:UI/GObject.cs (行 497)

icon​

virtual public string icon { get; set; }

源码:UI/GObject.cs (行 1430)

id​

public string id { get; private set; }

GObject的id,仅作为内部使用。与name不同,id值是不会相同的。 id is for internal use only.

源码:UI/GObject.cs (行 13)

inContainer​

public bool inContainer { get; }

If the object has lowlevel displayobject and the displayobject has a container parent?

源码:UI/GObject.cs (行 1131)

isDisposed​

public bool isDisposed { get; }

源码:UI/GObject.cs (行 1659)

onAddedToStage​

public EventListener onAddedToStage { get; }

Dispatched when the object was added to the stage.

源码:UI/GObject.cs (行 229)

onClick​

public EventListener onClick { get; }

Dispatched when the object or its child was clicked.

源码:UI/GObject.cs (行 173)

onClickLink​

public EventListener onClickLink { get; }

Dispatched when links in the object or its child was clicked.

源码:UI/GObject.cs (行 253)

onDragEnd​

public EventListener onDragEnd { get; }

Dispatched when drag end.

源码:UI/GObject.cs (行 293)

onDragMove​

public EventListener onDragMove { get; }

Dispatched when dragging.

源码:UI/GObject.cs (行 285)

onDragStart​

public EventListener onDragStart { get; }

Dispatched when drag start.

源码:UI/GObject.cs (行 277)

onFocusIn​

public EventListener onFocusIn { get; }

源码:UI/GObject.cs (行 309)

onFocusOut​

public EventListener onFocusOut { get; }

源码:UI/GObject.cs (行 317)

onGearStop​

public EventListener onGearStop { get; }

源码:UI/GObject.cs (行 301)

onKeyDown​

public EventListener onKeyDown { get; }

Dispatched on key pressed when the object is in focus.

源码:UI/GObject.cs (行 245)

onPositionChanged​

public EventListener onPositionChanged { get; }

Dispatched when the object was moved.

源码:UI/GObject.cs (行 261)

onRemovedFromStage​

public EventListener onRemovedFromStage { get; }

Dispatched when the object was removed from the stage.

源码:UI/GObject.cs (行 237)

onRightClick​

public EventListener onRightClick { get; }

Dispatched when the object or its child was clicked by right mouse button. Web only.

源码:UI/GObject.cs (行 181)

onRollOut​

public EventListener onRollOut { get; }

The cursor or finger leave an object.

源码:UI/GObject.cs (行 221)

onRollOver​

public EventListener onRollOver { get; }

The cursor or finger hovers over an object.

源码:UI/GObject.cs (行 213)

onSizeChanged​

public EventListener onSizeChanged { get; }

Dispatched when the object was resized.

源码:UI/GObject.cs (行 269)

onStage​

public bool onStage { get; }

If the object is on stage.

源码:UI/GObject.cs (行 1142)

onTouchBegin​

public EventListener onTouchBegin { get; }

Dispatched when the finger touched the object or its child just now.

源码:UI/GObject.cs (行 189)

onTouchEnd​

public EventListener onTouchEnd { get; }

Dispatched when the finger was lifted from the screen or from the mouse button.

源码:UI/GObject.cs (行 205)

onTouchMove​

public EventListener onTouchMove { get; }

源码:UI/GObject.cs (行 197)

parent​

public GComponent parent { get; private set; }

Parent object.

源码:UI/GObject.cs (行 78)

pivot​

public Vector2 pivot { get; set; }

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

源码:UI/GObject.cs (行 746)

pivotAsAnchor​

public bool pivotAsAnchor { get; set; }

源码:UI/GObject.cs (行 752)

pivotX​

public float pivotX { get; set; }

The x coordinate of the object's origin in its own coordinate space.

源码:UI/GObject.cs (行 722)

pivotY​

public float pivotY { get; set; }

The y coordinate of the object's origin in its own coordinate space.

源码:UI/GObject.cs (行 734)

pixelSnapping​

public bool pixelSnapping { get; set; }

源码:UI/GObject.cs (行 436)

position​

public Vector3 position { get; set; }

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

源码:UI/GObject.cs (行 370)

relations​

public Relations relations { get; private set; }

Relations Object.

源码:UI/GObject.cs (行 68)

resourceURL​

public string resourceURL { get; }

Resource url of this object.

源码:UI/GObject.cs (行 1153)

root​

public GRoot root { get; }

源码:UI/GObject.cs (行 1396)

rotation​

public float rotation { get; set; }

The rotation around the z axis of the object in degrees.

源码:UI/GObject.cs (行 851)

rotationX​

public float rotationX { get; set; }

The rotation around the x axis of the object in degrees.

源码:UI/GObject.cs (行 869)

rotationY​

public float rotationY { get; set; }

The rotation around the y axis of the object in degrees.

源码:UI/GObject.cs (行 886)

scale​

public Vector2 scale { get; set; }

The scale factor.

源码:UI/GObject.cs (行 676)

scaleX​

public float scaleX { get; set; }

The horizontal scale factor. '1' means no scale, cannt be negative.

源码:UI/GObject.cs (行 652)

scaleY​

public float scaleY { get; set; }

The vertical scale factor. '1' means no scale, cannt be negative.

源码:UI/GObject.cs (行 664)

size​

public Vector2 size { get; set; }

The size of the object in pixels.

源码:UI/GObject.cs (行 512)

skew​

public Vector2 skew { get; set; }

源码:UI/GObject.cs (行 702)

sortingOrder​

public int sortingOrder { get; set; }

By default(when sortingOrder==0), object added to component is arrange by the added roder. The bigger is the sorting order, the object is more in front.

源码:UI/GObject.cs (行 971)

tabStop​

public bool tabStop { get; set; }

If the object can be navigated by TAB?

源码:UI/GObject.cs (行 1000)

text​

virtual public string text { get; set; }

源码:UI/GObject.cs (行 1421)

tooltips​

public string tooltips { get; set; }

Tooltips of this object. UIConfig.tooltipsWin must be set first.

源码:UI/GObject.cs (行 1035)

touchable​

public bool touchable { get; set; }

If the object can touch or click. GImage/GTextField is not touchable even it is true.

源码:UI/GObject.cs (行 793)

treeNode​

public GTreeNode treeNode { get; }

源码:UI/GObject.cs (行 1831)

visible​

public bool visible { get; set; }

The visibility of the object. An invisible object will be untouchable.

源码:UI/GObject.cs (行 922)

width​

public float width { get; set; }

The width of the object in pixels.

源码:UI/GObject.cs (行 482)

x​

public float x { get; set; }

The x coordinate of the object relative to the local coordinates of the parent.

源码:UI/GObject.cs (行 325)

xMin​

public float xMin { get; set; }

源码:UI/GObject.cs (行 616)

xy​

public Vector2 xy { get; set; }

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

源码:UI/GObject.cs (行 361)

y​

public float y { get; set; }

The y coordinate of the object relative to the local coordinates of the parent.

源码:UI/GObject.cs (行 337)

yMin​

public float yMin { get; set; }

源码:UI/GObject.cs (行 634)

z​

public float z { get; set; }

The z coordinate of the object relative to the local coordinates of the parent.

源码:UI/GObject.cs (行 349)