跳到主要内容

Stage

命名空间:FairyGUI
源码:Assets/Scripts/Core/Stage.cs (行 18)

public class Stage : Container

继承:EventDispatcher → DisplayObject → Container → Stage

继承成员​

Container

onUpdate, clipSoftness, hitArea, opaque, renderCamera, renderMode, reversedMask, touchChildren, AddChild, AddChildAt, ChangeChildrenOrder, Contains, CreateGraphics, GetBounds, GetChild, GetChildAt, GetChildIndex, GetChildren, GetDescendants, GetRenderCamera, HitTest, InvalidateBatchingState, IsAncestorOf, RemoveChild, RemoveChildAt, RemoveChildren, SetChildIndex, SetChildrenLayer, SwapChildren, SwapChildrenAt, Update, clipRect, fairyBatching, mask, numChildren, tabStopChildren

DisplayObject

onPaint, _contentRect, _flags, _paintingInfo, _paintingMode, _vertexMatrix, gOwner, id, name, AddToBatch, CreateGameObject, DestroyGameObject, EnsureSizeCorrect, EnterPaintingMode, GetScreenShot, GlobalToLocal, LeavePaintingMode, LocalToGlobal, LocalToWorld, OnSizeChanged, RemoveFromParent, SetGameObject, SetLayer, SetPosition, SetRenderingOrder, SetScale, SetSize, SetXY, TransformPoint, TransformRect, TransformRectPoint, WorldToLocal, alpha, blendMode, cacheAsBitmap, cachedTransform, cursor, filter, focalLength, focusable, focused, gameObject, graphics, grayed, height, home, isDisposed, layer, location, material, onAddedToStage, onClickLink, onClick, onFocusIn, onFocusOut, onKeyDown, onMouseWheel, onRemovedFromStage, onRightClick, onRollOut, onRollOver, onTouchBegin, onTouchEnd, onTouchMove, paintingGraphics, paintingMode, parent, perspective, pivot, pixelPerfect, position, renderingOrder, rotationX, rotationY, rotation, scaleX, scaleY, scale, shader, size, skew, stage, tabStop, topmost, touchDisabled, touchable, visible, width, worldSpaceContainer, xy, x, y, z

EventDispatcher

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

构造函数​

Stage()​

public Stage();

源码:Core/Stage.cs (行 206)

事件​

afterUpdate​

public event Action afterUpdate;

源码:Core/Stage.cs (行 32)

beforeUpdate​

public event Action beforeUpdate;

源码:Core/Stage.cs (行 31)

方法​

AddTouchMonitor(int, EventDispatcher)​

public void AddTouchMonitor(int touchId, EventDispatcher target);
参数类型说明
touchIdint
targetEventDispatcher

源码:Core/Stage.cs (行 1510)

ApplyPanelOrder(Container)​

public void ApplyPanelOrder(Container target);

设置UIPanel/UIPainter等的渲染层次,由UIPanel等内部调用。开发者不需要调用。

参数类型说明
targetContainer

源码:Core/Stage.cs (行 1390)

CancelClick(int)​

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

源码:Core/Stage.cs (行 640)

CloseKeyboard()​

public void CloseKeyboard();

源码:Core/Stage.cs (行 720)

DisableSound()​

public void DisableSound();

源码:Core/Stage.cs (行 665)

Dispose()​

public override void Dispose();

源码:Core/Stage.cs (行 285)

DoKeyNavigate(bool)​

public void DoKeyNavigate(bool backward);
参数类型说明
backwardbool

源码:Core/Stage.cs (行 487)

EnableSound()​

public void EnableSound();

源码:Core/Stage.cs (行 653)

ForceUpdate()​

public void ForceUpdate();

源码:Core/Stage.cs (行 793)

GetAllTouch(int[])​

public int[] GetAllTouch(int[] result);
参数类型说明
resultint[]

源码:Core/Stage.cs (行 603)

GetTouchPosition(int)​

public Vector2 GetTouchPosition(int touchId);
参数类型说明
touchIdint

源码:Core/Stage.cs (行 557)

GetTouchTarget(int)​

public DisplayObject GetTouchTarget(int touchId);
参数类型说明
touchIdint

源码:Core/Stage.cs (行 579)

InputString(string)​

public void InputString(string value);

输入字符到当前光标位置

参数类型说明
valuestring

源码:Core/Stage.cs (行 732)

Instantiate()​

public static void Instantiate();

源码:Core/Stage.cs (行 102)

IsTouchMonitoring(EventDispatcher)​

public bool IsTouchMonitoring(EventDispatcher target);
参数类型说明
targetEventDispatcher

源码:Core/Stage.cs (行 1535)

MonitorTexture(NTexture)​

public void MonitorTexture(NTexture texture);
参数类型说明
textureNTexture

源码:Core/Stage.cs (行 1480)

OpenKeyboard(string, bool, bool, bool, bool, string, int, bool)​

public void OpenKeyboard(string text, bool autocorrection, bool multiline, bool secure, bool alert, string textPlaceholder, int keyboardType, bool hideInput);
参数类型说明
textstring
autocorrectionbool
multilinebool
securebool
alertbool
textPlaceholderstring
keyboardTypeint
hideInputbool

源码:Core/Stage.cs (行 707)

PlayOneShotSound(AudioClip)​

public void PlayOneShotSound(AudioClip clip);
参数类型说明
clipAudioClip

源码:Core/Stage.cs (行 689)

PlayOneShotSound(AudioClip, float)​

public void PlayOneShotSound(AudioClip clip, float volumeScale);
参数类型说明
clipAudioClip
volumeScalefloat

源码:Core/Stage.cs (行 679)

RegisterCursor(string, Texture2D, Vector2)​

public void RegisterCursor(string cursorName, Texture2D texture, Vector2 hotspot);
参数类型说明
cursorNamestring
textureTexture2D
hotspotVector2

源码:Core/Stage.cs (行 1565)

RemoveTouchMonitor(EventDispatcher)​

public void RemoveTouchMonitor(EventDispatcher target);
参数类型说明
targetEventDispatcher

源码:Core/Stage.cs (行 1524)

ResetInputState()​

public void ResetInputState();

源码:Core/Stage.cs (行 624)

SetCustomInput(Vector2, bool)​

public void SetCustomInput(Vector2 screenPos, bool buttonDown);
参数类型说明
screenPosVector2
buttonDownbool

源码:Core/Stage.cs (行 743)

SetCustomInput(Vector2, bool, bool)​

public void SetCustomInput(Vector2 screenPos, bool buttonDown, bool buttonUp);
参数类型说明
screenPosVector2
buttonDownbool
buttonUpbool

源码:Core/Stage.cs (行 757)

SetCustomInput(RaycastHit, bool)​

public void SetCustomInput(ref RaycastHit hit, bool buttonDown);
参数类型说明
hitRaycastHit
buttonDownbool

源码:Core/Stage.cs (行 773)

SetCustomInput(RaycastHit, bool, bool)​

public void SetCustomInput(ref RaycastHit hit, bool buttonDown, bool buttonUp);
参数类型说明
hitRaycastHit
buttonDownbool
buttonUpbool

源码:Core/Stage.cs (行 786)

SetFocus(DisplayObject, bool)​

public void SetFocus(DisplayObject newFocus, bool byKey = false);
参数类型说明
newFocusDisplayObject
byKeybool

源码:Core/Stage.cs (行 340)

SortWorldSpacePanelsByZOrder(int)​

public void SortWorldSpacePanelsByZOrder(int panelSortingOrder);

Adjust display order of all UIPanels rendering in worldspace by their z order.

参数类型说明
panelSortingOrderintOnly UIPanel.sortingOrder equals to this value will be involve in this sorting

源码:Core/Stage.cs (行 1435)

属性​

activeCursor​

public string activeCursor { get; }

源码:Core/Stage.cs (行 1574)

devicePixelRatio​

public static float devicePixelRatio { get; set; }

As unity does not provide ways to detect this, you should set it by yourself. This will effect: 1. compoistion cursor pos. 2. mouse wheel speed.

源码:Core/Stage.cs (行 190)

focus​

public DisplayObject focus { get; set; }

源码:Core/Stage.cs (行 326)

inst​

public static Stage inst { get; }

源码:Core/Stage.cs (行 74)

isTouchOnUI​

public static bool isTouchOnUI { get; }

源码:Core/Stage.cs (行 176)

keyboard​

public static IKeyboard keyboard { get; set; }

源码:Core/Stage.cs (行 167)

keyboardInput​

public static bool keyboardInput { get; set; }

如果是true,表示使用屏幕上弹出的键盘输入文字。常见于移动设备。 如果是false,表示是接受按键消息输入文字。常见于PC。 一般来说,不需要设置,底层会自动根据系统环境设置正确的值。

源码:Core/Stage.cs (行 149)

mouseWheelScale​

public static float mouseWheelScale { get; set; }

The scale of the mouse scroll delta.

源码:Core/Stage.cs (行 198)

onStageResized​

public EventListener onStageResized { get; }

源码:Core/Stage.cs (行 301)

soundVolume​

public float soundVolume { get; set; }

源码:Core/Stage.cs (行 29)

stageHeight​

public int stageHeight { get; }

源码:Core/Stage.cs (行 20)

stageWidth​

public int stageWidth { get; }

源码:Core/Stage.cs (行 23)

touchCount​

public int touchCount { get; }

源码:Core/Stage.cs (行 598)

touchPosition​

public Vector2 touchPosition { get; }

源码:Core/Stage.cs (行 543)

touchScreen​

public static bool touchScreen { get; set; }

如果是true,表示触摸输入,将使用Input.GetTouch接口读取触摸屏输入。 如果是false,表示使用鼠标输入,将使用Input.GetMouseButtonXXX接口读取鼠标输入。 一般来说,不需要设置,底层会自动根据系统环境设置正确的值。

源码:Core/Stage.cs (行 120)

touchTarget​

public DisplayObject touchTarget { get; }

源码:Core/Stage.cs (行 309)