跳到主要内容

GButton

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

public class GButton : GComponent, IColorGear

GButton class.

继承:EventDispatcher → GObject → GComponent → GButton

接口:IColorGear

继承成员​

GComponent

__onConstruct, __onDispose, _apexIndex, _boundsChanged, _childrenRenderOrder, _margin, _trackBounds, AddChild, AddChildAt, AddController, CallLua, ChangeChildrenOrder, ConstructFromResource, ConstructFromXML, CreateDisplayObject, Dispose, EnsureBoundsCorrect, GetChild, GetChildAt, GetChildByPath, GetChildInGroup, GetChildIndex, GetChildren, GetController, GetControllerAt, GetFirstChildInView, GetSnappingPosition, GetSnappingPositionWithDir, GetTransition, GetTransitionAt, GetVisibleChild, HandleSizeChanged, InvalidateBatchingState, IsAncestorOf, IsChildInView, OnUpdate, RemoveChild, RemoveChildAt, RemoveChildren, RemoveController, SetBounds, SetBoundsChangedFlag, SetChildIndex, SetChildIndexBefore, SetLuaPeer, SetupOverflow, SetupScroll, ShouldSnapToNext, SwapChildren, SwapChildrenAt, UpdateBounds, Controllers, Transitions, apexIndex, baseUserData, childrenRenderOrder, clipSoftness, container, fairyBatching, margin, mask, numChildren, onDrop, opaque, reversedMask, rootContainer, scrollPane, tabStopChildren, viewHeight, viewWidth

GObject

data, dragBounds, initHeight, initWidth, maxHeight, maxWidth, minHeight, minWidth, name, packageItem, sourceHeight, sourceWidth, underConstruct, AddRelation, Center, GetGear, GlobalToLocal, HandleAlphaChanged, HandlePositionChanged, HandleScaleChanged, HandleVisibleChanged, LocalToGlobal, LocalToRoot, MakeFullScreen, RemoveFromParent, RemoveRelation, RequestFocus, RootToLocal, SetHome, SetPivot, SetPosition, SetScale, SetSize, SetSizeDirectly, SetXY, Setup_BeforeAdd, 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, 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, tooltips, touchable, treeNode, visible, width, xMin, xy, x, yMin, y, z

EventDispatcher

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

构造函数​

GButton()​

public GButton();

源码:UI/GButton.cs (行 61)

字段​

DISABLED​

public const string DISABLED = "disabled";

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

DOWN​

public const string DOWN = "down";

源码:UI/GButton.cs (行 55)

OVER​

public const string OVER = "over";

源码:UI/GButton.cs (行 56)

SELECTED_DISABLED​

public const string SELECTED_DISABLED = "selectedDisabled";

源码:UI/GButton.cs (行 59)

SELECTED_OVER​

public const string SELECTED_OVER = "selectedOver";

源码:UI/GButton.cs (行 57)

UP​

public const string UP = "up";

源码:UI/GButton.cs (行 54)

_iconObject​

protected GObject _iconObject;

源码:UI/GButton.cs (行 34)

_relatedController​

protected Controller _relatedController;

源码:UI/GButton.cs (行 35)

_relatedPageId​

protected string _relatedPageId;

源码:UI/GButton.cs (行 36)

_titleObject​

protected GObject _titleObject;

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

changeStateOnClick​

public bool changeStateOnClick;

For radio or checkbox. if false, the button will not change selected status on click. Default is true. 如果为true,对于单选和多选按钮,当玩家点击时,按钮会自动切换状态。设置为false,则不会。默认为true。

源码:UI/GButton.cs (行 25)

linkedPopup​

public GObject linkedPopup;

Show a popup on click. 可以为按钮设置一个关联的组件,当按钮被点击时,此组件被自动弹出。

源码:UI/GButton.cs (行 31)

sound​

public NAudioClip sound;

Play sound when button is clicked.

源码:UI/GButton.cs (行 14)

soundVolumeScale​

public float soundVolumeScale;

Volume of the click sound. (0-1)

源码:UI/GButton.cs (行 19)

方法​

ConstructExtension(ByteBuffer)​

override protected void ConstructExtension(ByteBuffer buffer);
参数类型说明
bufferByteBuffer

源码:UI/GButton.cs (行 466)

FireClick(bool, bool)​

public void FireClick(bool downEffect, bool clickCall = false);

Simulates a click on this button. 模拟点击这个按钮。

参数类型说明
downEffectboolIf the down effect will simulate too.
clickCallbool

源码:UI/GButton.cs (行 324)

GetTextField()​

public GTextField GetTextField();

源码:UI/GButton.cs (行 356)

HandleControllerChanged(Controller)​

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

源码:UI/GButton.cs (行 435)

HandleGrayedChanged()​

override protected void HandleGrayedChanged();

源码:UI/GButton.cs (行 443)

SetCurrentState()​

protected void SetCurrentState();

源码:UI/GButton.cs (行 417)

SetState(string)​

protected void SetState(string val);
参数类型说明
valstring

源码:UI/GButton.cs (行 368)

Setup_AfterAdd(ByteBuffer, int)​

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

源码:UI/GButton.cs (行 499)

属性​

color​

public Color color { get; set; }

源码:UI/GButton.cs (行 187)

icon​

override public string icon { get; set; }

Icon of the button.

源码:UI/GButton.cs (行 82)

mode​

public ButtonMode mode { get; set; }

Button mode.

源码:UI/GButton.cs (行 267)

onChanged​

public EventListener onChanged { get; }

Dispatched when the button status was changed. 如果为单选或多选按钮,当按钮的选中状态发生改变时,此事件触发。

源码:UI/GButton.cs (行 74)

relatedController​

public Controller relatedController { get; set; }

A controller is connected to this button, the activate page of this controller will change while the button status changed. 对应编辑器中的单选控制器。

源码:UI/GButton.cs (行 288)

relatedPageId​

public string relatedPageId { get; set; }

源码:UI/GButton.cs (行 307)

selected​

public bool selected { get; set; }

If the button is in selected status.

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

selectedIcon​

public string selectedIcon { get; set; }

Icon value on selected status.

源码:UI/GButton.cs (行 128)

selectedTitle​

public string selectedTitle { get; set; }

Title value on selected status.

源码:UI/GButton.cs (行 146)

text​

override public string text { get; set; }

Same of the title.

源码:UI/GButton.cs (行 119)

title​

public string title { get; set; }

Title of the button

源码:UI/GButton.cs (行 101)

titleColor​

public Color titleColor { get; set; }

Title color.

源码:UI/GButton.cs (行 163)

titleFontSize​

public int titleFontSize { get; set; }

源码:UI/GButton.cs (行 196)