Stage
Namespace:FairyGUI
Source:Assets/Scripts/Core/Stage.cs (line 18)
public class Stage : Container
Inheritance:EventDispatcher → DisplayObject → Container → Stage
Inherited members
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
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
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);
| Parameter | Type | Description |
|---|---|---|
touchId | int | |
target | EventDispatcher |
Source:Core/Stage.cs (line 1510)
ApplyPanelOrder(Container)
public void ApplyPanelOrder(Container target);
设置UIPanel/UIPainter等的渲染层次,由UIPanel等内部调用。开发者不需要调用。
| Parameter | Type | Description |
|---|---|---|
target | Container |
Source:Core/Stage.cs (line 1390)
CancelClick(int)
public void CancelClick(int touchId);
| Parameter | Type | Description |
|---|---|---|
touchId | int |
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);
| Parameter | Type | Description |
|---|---|---|
backward | bool |
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);
| Parameter | Type | Description |
|---|---|---|
result | int[] |
Source:Core/Stage.cs (line 603)
GetTouchPosition(int)
public Vector2 GetTouchPosition(int touchId);
| Parameter | Type | Description |
|---|---|---|
touchId | int |
Source:Core/Stage.cs (line 557)
GetTouchTarget(int)
public DisplayObject GetTouchTarget(int touchId);
| Parameter | Type | Description |
|---|---|---|
touchId | int |
Source:Core/Stage.cs (line 579)
InputString(string)
public void InputString(string value);
输入字符到当前光标位置
| Parameter | Type | Description |
|---|---|---|
value | string |
Source:Core/Stage.cs (line 732)
Instantiate()
public static void Instantiate();
Source:Core/Stage.cs (line 102)
IsTouchMonitoring(EventDispatcher)
public bool IsTouchMonitoring(EventDispatcher target);
| Parameter | Type | Description |
|---|---|---|
target | EventDispatcher |
Source:Core/Stage.cs (line 1535)
MonitorTexture(NTexture)
public void MonitorTexture(NTexture texture);
| Parameter | Type | Description |
|---|---|---|
texture | NTexture |
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);
| Parameter | Type | Description |
|---|---|---|
text | string | |
autocorrection | bool | |
multiline | bool | |
secure | bool | |
alert | bool | |
textPlaceholder | string | |
keyboardType | int | |
hideInput | bool |
Source:Core/Stage.cs (line 707)
PlayOneShotSound(AudioClip)
public void PlayOneShotSound(AudioClip clip);
| Parameter | Type | Description |
|---|---|---|
clip | AudioClip |
Source:Core/Stage.cs (line 689)
PlayOneShotSound(AudioClip, float)
public void PlayOneShotSound(AudioClip clip, float volumeScale);
| Parameter | Type | Description |
|---|---|---|
clip | AudioClip | |
volumeScale | float |
Source:Core/Stage.cs (line 679)
RegisterCursor(string, Texture2D, Vector2)
public void RegisterCursor(string cursorName, Texture2D texture, Vector2 hotspot);
| Parameter | Type | Description |
|---|---|---|
cursorName | string | |
texture | Texture2D | |
hotspot | Vector2 |
Source:Core/Stage.cs (line 1565)
RemoveTouchMonitor(EventDispatcher)
public void RemoveTouchMonitor(EventDispatcher target);
| Parameter | Type | Description |
|---|---|---|
target | EventDispatcher |
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);
| Parameter | Type | Description |
|---|---|---|
screenPos | Vector2 | |
buttonDown | bool |
Source:Core/Stage.cs (line 743)
SetCustomInput(Vector2, bool, bool)
public void SetCustomInput(Vector2 screenPos, bool buttonDown, bool buttonUp);
| Parameter | Type | Description |
|---|---|---|
screenPos | Vector2 | |
buttonDown | bool | |
buttonUp | bool |
Source:Core/Stage.cs (line 757)
SetCustomInput(RaycastHit, bool)
public void SetCustomInput(ref RaycastHit hit, bool buttonDown);
| Parameter | Type | Description |
|---|---|---|
hit | RaycastHit | |
buttonDown | bool |
Source:Core/Stage.cs (line 773)
SetCustomInput(RaycastHit, bool, bool)
public void SetCustomInput(ref RaycastHit hit, bool buttonDown, bool buttonUp);
| Parameter | Type | Description |
|---|---|---|
hit | RaycastHit | |
buttonDown | bool | |
buttonUp | bool |
Source:Core/Stage.cs (line 786)
SetFocus(DisplayObject, bool)
public void SetFocus(DisplayObject newFocus, bool byKey = false);
| Parameter | Type | Description |
|---|---|---|
newFocus | DisplayObject | |
byKey | bool |
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.
| Parameter | Type | Description |
|---|---|---|
panelSortingOrder | int | Only 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)