GGraph
Namespace:FairyGUI
Source:Assets/Scripts/UI/GGraph.cs (line 14)
public class GGraph : GObject, IColorGear
GGraph class. 对应编辑器里的图形对象。图形有两个用途,一是用来显示简单的图形,例如矩形等;二是作为一个占位的用途, 可以将本对象替换为其他对象,或者在它的前后添加其他对象,相当于一个位置和深度的占位;还可以直接将内容设置 为原生对象。
Inheritance:EventDispatcher → GObject → GGraph
Interfaces:IColorGear
Inherited members
data, dragBounds, initHeight, initWidth, maxHeight, maxWidth, minHeight, minWidth, name, packageItem, sourceHeight, sourceWidth, underConstruct, AddRelation, Center, ConstructFromResource, Dispose, GetGear, GlobalToLocal, HandleAlphaChanged, HandleControllerChanged, HandleGrayedChanged, HandlePositionChanged, HandleScaleChanged, HandleSizeChanged, HandleVisibleChanged, InvalidateBatchingState, LocalToGlobal, LocalToRoot, MakeFullScreen, RemoveFromParent, RemoveRelation, RequestFocus, RootToLocal, SetHome, SetPivot, SetPosition, SetScale, SetSize, SetSizeDirectly, SetXY, Setup_AfterAdd, StartDrag, StopDrag, TransformPoint, TransformRect, TweenFade, TweenMove, TweenMoveX, TweenMoveY, TweenResize, TweenRotate, TweenScale, TweenScaleX, TweenScaleY, UpdateGear, WorldToLocal, actualHeight, actualWidth, alpha, asButton, asComboBox, asCom, asGraph, asGroup, asImage, asLabel, asList, asLoader3D, asLoader, asMovieClip, asProgress, asRichTextField, asSlider, asTextField, asTextInput, asTree, blendMode, cursor, displayObject, dragStartPos, draggable, draggingObject, dragging, enabled, filter, focusable, focused, gameObjectName, gearLook, gearSize, gearXY, grayed, group, height, icon, id, inContainer, isDisposed, onAddedToStage, onClickLink, onClick, onDragEnd, onDragMove, onDragStart, onFocusIn, onFocusOut, onGearStop, onKeyDown, onPositionChanged, onRemovedFromStage, onRightClick, onRollOut, onRollOver, onSizeChanged, onStage, onTouchBegin, onTouchEnd, onTouchMove, parent, pivotAsAnchor, pivotX, pivotY, pivot, pixelSnapping, position, relations, resourceURL, root, rotationX, rotationY, rotation, scaleX, scaleY, scale, size, skew, sortingOrder, tabStop, text, tooltips, touchable, treeNode, visible, width, xMin, xy, x, yMin, y, z
AddCapture, AddEventListener, BroadcastEvent, BubbleEvent, DispatchEvent, RemoveCapture, RemoveEventListener, RemoveEventListeners, hasEventListeners, isDispatching
Constructors
GGraph()
public GGraph();
Source:UI/GGraph.cs (line 18)
Methods
AddAfterMe(GObject)
public void AddAfterMe(GObject target);
Add another object after this object. 在显示列表中,将另一个对象插入到这个对象的后面。
| Parameter | Type | Description |
|---|---|---|
target | GObject | Target object. |
Source:UI/GGraph.cs (line 74)
AddBeforeMe(GObject)
public void AddBeforeMe(GObject target);
Add another object before this object. 在显示列表中,将另一个对象插入到这个对象的前面。
| Parameter | Type | Description |
|---|---|---|
target | GObject | Target object. |
Source:UI/GGraph.cs (line 60)
CreateDisplayObject()
override protected void CreateDisplayObject();
Source:UI/GGraph.cs (line 22)
DrawEllipse(float, float, Color)
public void DrawEllipse(float aWidth, float aHeight, Color fillColor);
| Parameter | Type | Description |
|---|---|---|
aWidth | float | |
aHeight | float | |
fillColor | Color |
Source:UI/GGraph.cs (line 184)
DrawPolygon(float, float, IList<Vector2>, Color)
public void DrawPolygon(float aWidth, float aHeight, IList<Vector2> points, Color fillColor);
| Parameter | Type | Description |
|---|---|---|
aWidth | float | |
aHeight | float | |
points | IList<Vector2> | |
fillColor | Color |
Source:UI/GGraph.cs (line 197)
DrawPolygon(float, float, IList<Vector2>, Color, float, Color)
public void DrawPolygon(float aWidth, float aHeight, IList<Vector2> points, Color fillColor, float lineSize, Color lineColor);
| Parameter | Type | Description |
|---|---|---|
aWidth | float | |
aHeight | float | |
points | IList<Vector2> | |
fillColor | Color | |
lineSize | float | |
lineColor | Color |
Source:UI/GGraph.cs (line 212)
DrawRect(float, float, int, Color, Color)
public void DrawRect(float aWidth, float aHeight, int lineSize, Color lineColor, Color fillColor);
Draw a rectangle. 画矩形。
| Parameter | Type | Description |
|---|---|---|
aWidth | float | Width |
aHeight | float | Height |
lineSize | int | Line size |
lineColor | Color | Line color |
fillColor | Color | Fill color |
Source:UI/GGraph.cs (line 159)
DrawRoundRect(float, float, Color, float[])
public void DrawRoundRect(float aWidth, float aHeight, Color fillColor, float[] corner);
| Parameter | Type | Description |
|---|---|---|
aWidth | float | |
aHeight | float | |
fillColor | Color | |
corner | float[] |
Source:UI/GGraph.cs (line 172)
ReplaceMe(GObject)
public void ReplaceMe(GObject target);
Replace this object to another object in the display list. 在显示列表中,将指定对象取代这个图形对象。这个图形对象相当于一个占位的用途。
| Parameter | Type | Description |
|---|---|---|
target | GObject | Target object. |
Source:UI/GGraph.cs (line 34)
SetNativeObject(DisplayObject)
public void SetNativeObject(DisplayObject obj);
设置内容为一个原生对象。这个图形对象相当于一个占位的用途。
| Parameter | Type | Description |
|---|---|---|
obj | DisplayObject | 原生对象 |
Source:UI/GGraph.cs (line 88)
Setup_BeforeAdd(ByteBuffer, int)
override public void Setup_BeforeAdd(ByteBuffer buffer, int beginPos);
| Parameter | Type | Description |
|---|---|---|
buffer | ByteBuffer | |
beginPos | int |
Source:UI/GGraph.cs (line 218)
Properties
color
public Color color { get; set; }
Source:UI/GGraph.cs (line 122)
shape
public Shape shape { get; }
Get the shape object. It can be used for drawing. 获取图形的原生对象,可用于绘制图形。
Source:UI/GGraph.cs (line 145)