Class GameWindow
Provides in-editor play mode simulation.
Inheritance
Implements
Namespace: FlaxEditor.Windows
Assembly: FlaxEngine.CSharp.dll
Syntax
public class GameWindow : EditorWindow, IComparable, IDrawable
Constructors
GameWindow(Editor)
Initializes a new instance of the GameWindow class.
Declaration
public GameWindow(Editor editor)
Parameters
Editor
editor
The editor. |
Properties
CanOpenContentFinder
Gets a value indicating whether this window can open content finder popup.
Declaration
protected override bool CanOpenContentFinder { get; }
Property Value
System.Boolean
|
Overrides
CanUseNavigation
CenterMouseOnFocus
Gets or sets a value indicating whether center mouse position on window focus in play mode. Helps when working with games that lock mouse cursor.
Declaration
public bool CenterMouseOnFocus { get; set; }
Property Value
System.Boolean
|
FocusOnPlay
Gets or sets a value indicating whether auto-focus game window on play mode start.
Declaration
public bool FocusOnPlay { get; set; }
Property Value
System.Boolean
|
ShowDebugDraw
Gets or sets a value indicating whether show Debug Draw shapes in the view or keep it hidden.
Declaration
public bool ShowDebugDraw { get; set; }
Property Value
System.Boolean
|
ShowGUI
Gets or sets a value indicating whether show game GUI in the view or keep it hidden.
Declaration
public bool ShowGUI { get; set; }
Property Value
System.Boolean
|
UseLayoutData
Gets a value indicating whether window uses custom layout data.
Declaration
public override bool UseLayoutData { get; }
Property Value
System.Boolean
|
Overrides
Viewport
Gets the viewport.
Declaration
public RenderOutputControl Viewport { get; }
Property Value
FlaxEngine.GUI.RenderOutputControl
|
Methods
Draw()
FocusGameViewport()
Focuses the game viewport. Shows the window if hidden or unselected.
Declaration
public void FocusGameViewport()
OnEndContainsFocus()
Action fired when control lost 'Contains Focus' state
Declaration
public override void OnEndContainsFocus()
Overrides
OnKeyDown(KeyboardKeys)
When key goes down
Declaration
public override bool OnKeyDown(KeyboardKeys key)
Parameters
KeyboardKeys
key
Key value |
Returns
System.Boolean
True if event has been handled, otherwise false |
Overrides
OnLayoutDeserialize()
Called when during windows layout deserialization if window has no layout data to load. Can be used to restore default UI layout.
Declaration
public override void OnLayoutDeserialize()
Overrides
OnLayoutDeserialize(XmlElement)
Called when during windows layout deserialization. Each window can use it to load custom interface data (eg. splitter position).
Declaration
public override void OnLayoutDeserialize(XmlElement node)
Parameters
System.Xml.XmlElement
node
The Xml document node. |
Overrides
OnLayoutSerialize(XmlWriter)
Called when during windows layout serialization. Each window can use it to store custom interface data (eg. splitter position).
Declaration
public override void OnLayoutSerialize(XmlWriter writer)
Parameters
System.Xml.XmlWriter
writer
The Xml writer. |
Overrides
OnMouseDown(Float2, MouseButton)
When mouse goes down over control's area
Declaration
public override bool OnMouseDown(Float2 location, MouseButton button)
Parameters
Float2
location
Mouse location in Control Space |
MouseButton
button
Mouse buttons state (flags) |
Returns
System.Boolean
True if event has been handled, otherwise false |
Overrides
OnMouseLeave()
When mouse leaves control's area
Declaration
public override void OnMouseLeave()
Overrides
OnNavigate(NavDirection, Float2, Control, List<Control>)
OnPlayBegin()
Called when Editor is entering play mode.
Declaration
public override void OnPlayBegin()
Overrides
OnPlayEnd()
Called when Editor leaves the play mode.
Declaration
public override void OnPlayEnd()
Overrides
OnShowContextMenu(ContextMenu)
Called when dock panel wants to show the context menu for this window. Can be used to inject custom buttons and items to the context menu (on top).
Declaration
public override void OnShowContextMenu(ContextMenu menu)
Parameters
FlaxEditor.GUI.ContextMenu.ContextMenu
menu
The menu. |
Overrides
OnStartContainsFocus()
Action fired when control gets 'Contains Focus' state
Declaration
public override void OnStartContainsFocus()
Overrides
SetWindowMode(InterfaceOptions.GameWindowMode)
Apply the selected window mode to the game window.
Declaration
public void SetWindowMode(InterfaceOptions.GameWindowMode mode)
Parameters
InterfaceOptions.GameWindowMode
mode
|
TakeScreenshot()
Takes the screenshot of the current viewport.
Declaration
public void TakeScreenshot()
TakeScreenshot(String)
Takes the screenshot of the current viewport.
Declaration
public void TakeScreenshot(string path)
Parameters
System.String
path
The output file path. |
UnlockMouseInPlay()
Unlocks the mouse if game window is focused during play mode.
Declaration
public void UnlockMouseInPlay()