Skip to main content

Stage

Namespace:FairyGUI
Source:Assets/Scripts/Core/Stage.cs (line 18)

public class Stage : Container

Inheritance:EventDispatcher → DisplayObject → Container → Stage

Inherited members​

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

Constructors​

Stage()​

public Stage();

Source:Core/Stage.cs (line 206)

Events​

afterUpdate​

public event Action afterUpdate;

Source:Core/Stage.cs (line 32)

beforeUpdate​

public event Action beforeUpdate;

Source:Core/Stage.cs (line 31)

Methods​

AddTouchMonitor(int, EventDispatcher)​

public void AddTouchMonitor(int touchId, EventDispatcher target);
ParameterTypeDescription
touchIdint
targetEventDispatcher

Source:Core/Stage.cs (line 1510)

ApplyPanelOrder(Container)​

public void ApplyPanelOrder(Container target);

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

ParameterTypeDescription
targetContainer

Source:Core/Stage.cs (line 1390)

CancelClick(int)​

public void CancelClick(int touchId);
ParameterTypeDescription
touchIdint

Source:Core/Stage.cs (line 640)

CloseKeyboard()​

public void CloseKeyboard();

Source:Core/Stage.cs (line 720)

DisableSound()​

public void DisableSound();

Source:Core/Stage.cs (line 665)

Dispose()​

public override void Dispose();

Source:Core/Stage.cs (line 285)

DoKeyNavigate(bool)​

public void DoKeyNavigate(bool backward);
ParameterTypeDescription
backwardbool

Source:Core/Stage.cs (line 487)

EnableSound()​

public void EnableSound();

Source:Core/Stage.cs (line 653)

ForceUpdate()​

public void ForceUpdate();

Source:Core/Stage.cs (line 793)

GetAllTouch(int[])​

public int[] GetAllTouch(int[] result);
ParameterTypeDescription
resultint[]

Source:Core/Stage.cs (line 603)

GetTouchPosition(int)​

public Vector2 GetTouchPosition(int touchId);
ParameterTypeDescription
touchIdint

Source:Core/Stage.cs (line 557)

GetTouchTarget(int)​

public DisplayObject GetTouchTarget(int touchId);
ParameterTypeDescription
touchIdint

Source:Core/Stage.cs (line 579)

InputString(string)​

public void InputString(string value);

输入字符到当前光标位置

ParameterTypeDescription
valuestring

Source:Core/Stage.cs (line 732)

Instantiate()​

public static void Instantiate();

Source:Core/Stage.cs (line 102)

IsTouchMonitoring(EventDispatcher)​

public bool IsTouchMonitoring(EventDispatcher target);
ParameterTypeDescription
targetEventDispatcher

Source:Core/Stage.cs (line 1535)

MonitorTexture(NTexture)​

public void MonitorTexture(NTexture texture);
ParameterTypeDescription
textureNTexture

Source:Core/Stage.cs (line 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);
ParameterTypeDescription
textstring
autocorrectionbool
multilinebool
securebool
alertbool
textPlaceholderstring
keyboardTypeint
hideInputbool

Source:Core/Stage.cs (line 707)

PlayOneShotSound(AudioClip)​

public void PlayOneShotSound(AudioClip clip);
ParameterTypeDescription
clipAudioClip

Source:Core/Stage.cs (line 689)

PlayOneShotSound(AudioClip, float)​

public void PlayOneShotSound(AudioClip clip, float volumeScale);
ParameterTypeDescription
clipAudioClip
volumeScalefloat

Source:Core/Stage.cs (line 679)

RegisterCursor(string, Texture2D, Vector2)​

public void RegisterCursor(string cursorName, Texture2D texture, Vector2 hotspot);
ParameterTypeDescription
cursorNamestring
textureTexture2D
hotspotVector2

Source:Core/Stage.cs (line 1565)

RemoveTouchMonitor(EventDispatcher)​

public void RemoveTouchMonitor(EventDispatcher target);
ParameterTypeDescription
targetEventDispatcher

Source:Core/Stage.cs (line 1524)

ResetInputState()​

public void ResetInputState();

Source:Core/Stage.cs (line 624)

SetCustomInput(Vector2, bool)​

public void SetCustomInput(Vector2 screenPos, bool buttonDown);
ParameterTypeDescription
screenPosVector2
buttonDownbool

Source:Core/Stage.cs (line 743)

SetCustomInput(Vector2, bool, bool)​

public void SetCustomInput(Vector2 screenPos, bool buttonDown, bool buttonUp);
ParameterTypeDescription
screenPosVector2
buttonDownbool
buttonUpbool

Source:Core/Stage.cs (line 757)

SetCustomInput(RaycastHit, bool)​

public void SetCustomInput(ref RaycastHit hit, bool buttonDown);
ParameterTypeDescription
hitRaycastHit
buttonDownbool

Source:Core/Stage.cs (line 773)

SetCustomInput(RaycastHit, bool, bool)​

public void SetCustomInput(ref RaycastHit hit, bool buttonDown, bool buttonUp);
ParameterTypeDescription
hitRaycastHit
buttonDownbool
buttonUpbool

Source:Core/Stage.cs (line 786)

SetFocus(DisplayObject, bool)​

public void SetFocus(DisplayObject newFocus, bool byKey = false);
ParameterTypeDescription
newFocusDisplayObject
byKeybool

Source:Core/Stage.cs (line 340)

SortWorldSpacePanelsByZOrder(int)​

public void SortWorldSpacePanelsByZOrder(int panelSortingOrder);

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

ParameterTypeDescription
panelSortingOrderintOnly UIPanel.sortingOrder equals to this value will be involve in this sorting

Source:Core/Stage.cs (line 1435)

Properties​

activeCursor​

public string activeCursor { get; }

Source:Core/Stage.cs (line 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.

Source:Core/Stage.cs (line 190)

focus​

public DisplayObject focus { get; set; }

Source:Core/Stage.cs (line 326)

inst​

public static Stage inst { get; }

Source:Core/Stage.cs (line 74)

isTouchOnUI​

public static bool isTouchOnUI { get; }

Source:Core/Stage.cs (line 176)

keyboard​

public static IKeyboard keyboard { get; set; }

Source:Core/Stage.cs (line 167)

keyboardInput​

public static bool keyboardInput { get; set; }

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

Source:Core/Stage.cs (line 149)

mouseWheelScale​

public static float mouseWheelScale { get; set; }

The scale of the mouse scroll delta.

Source:Core/Stage.cs (line 198)

onStageResized​

public EventListener onStageResized { get; }

Source:Core/Stage.cs (line 301)

soundVolume​

public float soundVolume { get; set; }

Source:Core/Stage.cs (line 29)

stageHeight​

public int stageHeight { get; }

Source:Core/Stage.cs (line 20)

stageWidth​

public int stageWidth { get; }

Source:Core/Stage.cs (line 23)

touchCount​

public int touchCount { get; }

Source:Core/Stage.cs (line 598)

touchPosition​

public Vector2 touchPosition { get; }

Source:Core/Stage.cs (line 543)

touchScreen​

public static bool touchScreen { get; set; }

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

Source:Core/Stage.cs (line 120)

touchTarget​

public DisplayObject touchTarget { get; }

Source:Core/Stage.cs (line 309)