DisplayObject
Namespace:FairyGUI
Source:Assets/Scripts/Core/DisplayObject.cs (line 12)
public class DisplayObject : EventDispatcher, IBatchable
Inheritance:EventDispatcher → DisplayObject
Interfaces:IBatchable
Inherited members
AddCapture, AddEventListener, BroadcastEvent, BubbleEvent, DispatchEvent, RemoveCapture, RemoveEventListener, RemoveEventListeners, hasEventListeners, isDispatching
Constructors
DisplayObject()
public DisplayObject();
Source:Core/DisplayObject.cs (line 102)
Events
onPaint
public event Action onPaint;
Source:Core/DisplayObject.cs (line 47)
Fields
_contentRect
protected Rect _contentRect;
Source:Core/DisplayObject.cs (line 94)
_flags
protected internal Flags _flags;
Source:Core/DisplayObject.cs (line 96)
_paintingInfo
protected internal PaintingInfo _paintingInfo;
Source:Core/DisplayObject.cs (line 93)
_paintingMode
protected internal int _paintingMode;
Source:Core/DisplayObject.cs (line 92)
_vertexMatrix
protected NGraphics.VertexMatrix _vertexMatrix;
Source:Core/DisplayObject.cs (line 95)
gOwner
public GObject gOwner;
Source:Core/DisplayObject.cs (line 52)
id
public uint id;
Source:Core/DisplayObject.cs (line 57)
name
public string name;
Source:Core/DisplayObject.cs (line 17)
Methods
AddToBatch(List<BatchElement>, bool)
virtual public BatchElement AddToBatch(List<BatchElement> batchElements, bool force);
| Parameter | Type | Description |
|---|---|---|
batchElements | List<BatchElement> | |
force | bool |
Source:Core/DisplayObject.cs (line 1838)
CreateGameObject(string)
protected void CreateGameObject(string gameObjectName);
| Parameter | Type | Description |
|---|---|---|
gameObjectName | string |
Source:Core/DisplayObject.cs (line 229)
DestroyGameObject()
protected void DestroyGameObject();
Source:Core/DisplayObject.cs (line 253)
Dispose()
virtual public void Dispose();
Source:Core/DisplayObject.cs (line 1785)
EnsureSizeCorrect()
virtual public void EnsureSizeCorrect();
Source:Core/DisplayObject.cs (line 497)
EnterPaintingMode()
public void EnterPaintingMode();
进入绘画模式,整个对象将画到一张RenderTexture上,然后这种贴图将代替原有的显示内容。 可以在onPaint回调里对这张纹理进行进一步操作,实现特殊效果。
Source:Core/DisplayObject.cs (line 1093)
EnterPaintingMode(int, Margin?)
public void EnterPaintingMode(int requestorId, Margin? extend);
进入绘画模式,整个对象将画到一张RenderTexture上,然后这种贴图将代替原有的显示内容。 可以在onPaint回调里对这张纹理进行进一步操作,实现特殊效果。 可能有多个地方要求进入绘画模式,这里用requestorId加以区别,取值是1、2、4、8、16以此类推。1024内内部保留。用户自定义的id从1024开始。
| Parameter | Type | Description |
|---|---|---|
requestorId | int | |
extend | Margin? | 纹理四周的留空。如果特殊处理后的内容大于原内容,那么这里的设置可以使纹理扩大。 |
Source:Core/DisplayObject.cs (line 1105)
EnterPaintingMode(int, Margin?, float)
public void EnterPaintingMode(int requestorId, Margin? extend, float scale);
进入绘画模式,整个对象将画到一张RenderTexture上,然后这种贴图将代替原有的显示内容。 可以在onPaint回调里对这张纹理进行进一步操作,实现特殊效果。 可能有多个地方要求进入绘画模式,这里用requestorId加以区别,取值是1、2、4、8、16以此类推。1024内内部保留。用户自定义的id从1024开始。
| Parameter | Type | Description |
|---|---|---|
requestorId | int | 请求者id |
extend | Margin? | 扩展纹理。如果特殊处理后的内容大于原内容,那么这里的设置可以使纹理扩大。 |
scale | float | 附加一个缩放系数 |
Source:Core/DisplayObject.cs (line 1118)
GetBounds(DisplayObject)
virtual public Rect GetBounds(DisplayObject targetSpace);
| Parameter | Type | Description |
|---|---|---|
targetSpace | DisplayObject |
Source:Core/DisplayObject.cs (line 1320)
GetScreenShot(Margin?, float)
public Texture2D GetScreenShot(Margin? extend, float scale);
| Parameter | Type | Description |
|---|---|---|
extend | Margin? | |
scale | float |
Source:Core/DisplayObject.cs (line 1231)
GlobalToLocal(Vector2)
public Vector2 GlobalToLocal(Vector2 point);
将舞台坐标转换为本地坐标
| Parameter | Type | Description |
|---|---|---|
point | Vector2 |
Source:Core/DisplayObject.cs (line 1371)
HitTest()
virtual protected DisplayObject HitTest();
Source:Core/DisplayObject.cs (line 1353)
InvalidateBatchingState()
public void InvalidateBatchingState();
Source:Core/DisplayObject.cs (line 1579)
LeavePaintingMode(int)
public void LeavePaintingMode(int requestorId);
离开绘画模式
| Parameter | Type | Description |
|---|---|---|
requestorId | int |
Source:Core/DisplayObject.cs (line 1171)
LocalToGlobal(Vector2)
public Vector2 LocalToGlobal(Vector2 point);
将本地坐标转换为舞台坐标
| Parameter | Type | Description |
|---|---|---|
point | Vector2 |
Source:Core/DisplayObject.cs (line 1419)
LocalToWorld(Vector3)
public Vector3 LocalToWorld(Vector3 localPoint);
| Parameter | Type | Description |
|---|---|---|
localPoint | Vector3 |
Source:Core/DisplayObject.cs (line 1487)
OnSizeChanged()
virtual protected void OnSizeChanged();
Source:Core/DisplayObject.cs (line 501)
RemoveFromParent()
public void RemoveFromParent();
Source:Core/DisplayObject.cs (line 1570)
SetGameObject(GameObject)
protected void SetGameObject(GameObject gameObject);
| Parameter | Type | Description |
|---|---|---|
gameObject | GameObject |
Source:Core/DisplayObject.cs (line 244)
SetLayer(int, bool)
virtual protected bool SetLayer(int value, bool fromParent);
| Parameter | Type | Description |
|---|---|---|
value | int | |
fromParent | bool |
Source:Core/DisplayObject.cs (line 1732)
SetPosition(float, float, float)
public void SetPosition(float xv, float yv, float zv);
| Parameter | Type | Description |
|---|---|---|
xv | float | |
yv | float | |
zv | float |
Source:Core/DisplayObject.cs (line 379)
SetRenderingOrder(UpdateContext, bool)
virtual public void SetRenderingOrder(UpdateContext context, bool inBatch);
| Parameter | Type | Description |
|---|---|---|
context | UpdateContext | |
inBatch | bool |
Source:Core/DisplayObject.cs (line 880)
SetScale(float, float)
public void SetScale(float xv, float yv);
| Parameter | Type | Description |
|---|---|---|
xv | float | |
yv | float |
Source:Core/DisplayObject.cs (line 549)
SetSize(float, float)
public void SetSize(float wv, float hv);
| Parameter | Type | Description |
|---|---|---|
wv | float | |
hv | float |
Source:Core/DisplayObject.cs (line 478)
SetXY(float, float)
public void SetXY(float xv, float yv);
| Parameter | Type | Description |
|---|---|---|
xv | float | |
yv | float |
Source:Core/DisplayObject.cs (line 368)
TransformPoint(Vector2, DisplayObject)
public Vector2 TransformPoint(Vector2 point, DisplayObject targetSpace);
| Parameter | Type | Description |
|---|---|---|
point | Vector2 | |
targetSpace | DisplayObject | null if to world space |
Source:Core/DisplayObject.cs (line 1515)
TransformRect(Rect, DisplayObject)
public Rect TransformRect(Rect rect, DisplayObject targetSpace);
| Parameter | Type | Description |
|---|---|---|
rect | Rect | |
targetSpace | DisplayObject | null if to world space |
Source:Core/DisplayObject.cs (line 1533)
TransformRectPoint(float, float, DisplayObject, Vector4)
protected void TransformRectPoint(float px, float py, DisplayObject targetSpace, ref Vector4 vec4);
| Parameter | Type | Description |
|---|---|---|
px | float | |
py | float | |
targetSpace | DisplayObject | |
vec4 | Vector4 |
Source:Core/DisplayObject.cs (line 1557)
Update(UpdateContext)
virtual public void Update(UpdateContext context);
| Parameter | Type | Description |
|---|---|---|
context | UpdateContext |
Source:Core/DisplayObject.cs (line 1585)
WorldToLocal(Vector3, Vector3)
public Vector3 WorldToLocal(Vector3 worldPoint, Vector3 direction);
转换世界坐标点到等效的本地xy平面的点。等效的意思是他们在屏幕方向看到的位置一样。 返回的点是在对象的本地坐标空间,且z=0
| Parameter | Type | Description |
|---|---|---|
worldPoint | Vector3 | |
direction | Vector3 |
Source:Core/DisplayObject.cs (line 1447)
Properties
alpha
public float alpha { get; set; }
Source:Core/DisplayObject.cs (line 269)
blendMode
public BlendMode blendMode { get; set; }
Source:Core/DisplayObject.cs (line 1289)
cacheAsBitmap
public bool cacheAsBitmap { get; set; }
将整个显示对象(如果是容器,则容器包含的整个显示列表)静态化,所有内容被缓冲到一张纹理上。 DC将保持为1。CPU消耗将降到最低。但对象的任何变化不会更新。 当cacheAsBitmap已经为true时,再次调用cacheAsBitmap=true将会刷新对象一次。
Source:Core/DisplayObject.cs (line 1207)
cachedTransform
public Transform cachedTransform { get; protected set; }
Source:Core/DisplayObject.cs (line 32)
cursor
public string cursor { get; set; }
Source:Core/DisplayObject.cs (line 974)
filter
public IFilter filter { get; set; }
Source:Core/DisplayObject.cs (line 1259)
focalLength
public int focalLength { get; set; }
Source:Core/DisplayObject.cs (line 704)
focusable
public bool focusable { get; set; }
If the object can be focused?
Source:Core/DisplayObject.cs (line 919)
focused
public bool focused { get; }
If the object focused?
Source:Core/DisplayObject.cs (line 949)
gameObject
public GameObject gameObject { get; protected set; }
Source:Core/DisplayObject.cs (line 27)
graphics
public NGraphics graphics { get; protected set; }
Source:Core/DisplayObject.cs (line 37)
grayed
public bool grayed { get; set; }
Source:Core/DisplayObject.cs (line 278)
height
public float height { get; set; }
Source:Core/DisplayObject.cs (line 438)
home
public Transform home { get; set; }
为对象设置一个默认的父Transform。当对象不在显示列表里时,它的GameObject挂到哪里。
Source:Core/DisplayObject.cs (line 1677)
isDisposed
public bool isDisposed { get; }
Source:Core/DisplayObject.cs (line 991)
layer
public int layer { get; set; }
Source:Core/DisplayObject.cs (line 901)
location
public Vector3 location { get; set; }
This is the pivot position
Source:Core/DisplayObject.cs (line 814)
material
public Material material { get; set; }
Source:Core/DisplayObject.cs (line 834)
onAddedToStage
public EventListener onAddedToStage { get; }
Source:Core/DisplayObject.cs (line 183)
onClick
public EventListener onClick { get; }
Source:Core/DisplayObject.cs (line 119)
onClickLink
public EventListener onClickLink { get; }
Source:Core/DisplayObject.cs (line 207)
onFocusIn
public EventListener onFocusIn { get; }
Source:Core/DisplayObject.cs (line 215)
onFocusOut
public EventListener onFocusOut { get; }
Source:Core/DisplayObject.cs (line 223)
onKeyDown
public EventListener onKeyDown { get; }
Source:Core/DisplayObject.cs (line 199)
onMouseWheel
public EventListener onMouseWheel { get; }
Source:Core/DisplayObject.cs (line 175)
onRemovedFromStage
public EventListener onRemovedFromStage { get; }
Source:Core/DisplayObject.cs (line 191)
onRightClick
public EventListener onRightClick { get; }
Source:Core/DisplayObject.cs (line 127)
onRollOut
public EventListener onRollOut { get; }
Source:Core/DisplayObject.cs (line 167)
onRollOver
public EventListener onRollOver { get; }
Source:Core/DisplayObject.cs (line 159)
onTouchBegin
public EventListener onTouchBegin { get; }
Source:Core/DisplayObject.cs (line 135)
onTouchEnd
public EventListener onTouchEnd { get; }
Source:Core/DisplayObject.cs (line 151)
onTouchMove
public EventListener onTouchMove { get; }
Source:Core/DisplayObject.cs (line 143)
paintingGraphics
public NGraphics paintingGraphics { get; protected set; }
Source:Core/DisplayObject.cs (line 42)
paintingMode
public bool paintingMode { get; }
Source:Core/DisplayObject.cs (line 1197)
parent
public Container parent { get; private set; }
Source:Core/DisplayObject.cs (line 22)
perspective
public bool perspective { get; set; }
当对象处于ScreenSpace,也就是使用正交相机渲染时,对象虽然可以绕X轴或者Y轴旋转,但没有透视效果。设置perspective,可以模拟出透视效果。
Source:Core/DisplayObject.cs (line 679)
pivot
public Vector2 pivot { get; set; }
Source:Core/DisplayObject.cs (line 759)
pixelPerfect
public bool pixelPerfect { get; set; }
If the object position is align by pixel
Source:Core/DisplayObject.cs (line 401)
position
public Vector3 position { get; set; }
Source:Core/DisplayObject.cs (line 357)
renderingOrder
public int renderingOrder { get; }
Source:Core/DisplayObject.cs (line 872)
rotation
public float rotation { get; set; }
Source:Core/DisplayObject.cs (line 591)
rotationX
public float rotationX { get; set; }
Source:Core/DisplayObject.cs (line 615)
rotationY
public float rotationY { get; set; }
Source:Core/DisplayObject.cs (line 638)
scale
public Vector2 scale { get; set; }
Source:Core/DisplayObject.cs (line 579)
scaleX
public float scaleX { get; set; }
Source:Core/DisplayObject.cs (line 515)
scaleY
public float scaleY { get; set; }
Source:Core/DisplayObject.cs (line 531)
shader
public string shader { get; set; }
Source:Core/DisplayObject.cs (line 853)
size
public Vector2 size { get; set; }
Source:Core/DisplayObject.cs (line 460)
skew
public Vector2 skew { get; set; }
Source:Core/DisplayObject.cs (line 661)
stage
public Stage stage { get; }
Source:Core/DisplayObject.cs (line 1028)
tabStop
public bool tabStop { get; set; }
If the object can be navigated by TAB?
Source:Core/DisplayObject.cs (line 934)
topmost
public Container topmost { get; }
Source:Core/DisplayObject.cs (line 1014)
touchDisabled
public bool touchDisabled { get; }
Source:Core/DisplayObject.cs (line 1084)
touchable
public bool touchable { get; set; }
Source:Core/DisplayObject.cs (line 1062)
visible
public bool visible { get; set; }
Source:Core/DisplayObject.cs (line 287)
width
public float width { get; set; }
Source:Core/DisplayObject.cs (line 416)
worldSpaceContainer
public Container worldSpaceContainer { get; }
Source:Core/DisplayObject.cs (line 1039)
x
public float x { get; set; }
Source:Core/DisplayObject.cs (line 312)
xy
public Vector2 xy { get; set; }
Source:Core/DisplayObject.cs (line 348)
y
public float y { get; set; }
Source:Core/DisplayObject.cs (line 324)
z
public float z { get; set; }
Source:Core/DisplayObject.cs (line 336)