class
Screen

package haxe.ui.core


read-only
static
instance:Screen
References the main application's screen, in a cross-framework way.


currentMouseX:Float
The x position of the mouse on screen.

A lower value means the mouse is at the left side of the screen,
whie a higher value means the mouse is at the right side of the screen.
currentMouseY:Float
The y position of the mouse on screen.

A lower value means the mouse is closer to the top of the screen,
whie a higher value means the mouse is closer to the bottom of the screen.
read-only
actualHeight:Float
read-only
actualWidth:Float
read-only
dpi:Float
read-only
height:Float
read-only
isRetina:Bool
options:
rootComponents:Array<Component>
title:String
read-only
topComponent:Component
read-only
width:Float


override
addComponent(component:Component):Component
Adds a component/container to the screen.

When using this via Screen.instance.addComponent(), This method acts as some sort of a cross-framework way
to draw components/containers onto the main application's screen.

Parameters
component:Component
The component to add to the screen.

Returns
The added component.
findComponentsUnderPoint<T>(screenX:Float, screenY:Float, type:Class<T> = null):Array<Component>
Lists components under a specific point in global, screen coordinates.

Note: this function will return *every single* components at a specific point,
even if they have no backgrounds, or haven't got anything drawn onto them.

Parameters
screenX:Float
The global, on-screen x position of the point to check for components under
screenY:Float
The global, on-screen y position of the point to check for components under
type:Class<T> = null
Used to filter all components that aren't of a specific type. null by default, which means no filter is applied.

Returns
An array of all components that overlap the "global" position (x, y)
findSolidComponentUnderPoint<T>(screenX:Float, screenY:Float, type:Class<T> = null):Array<Component>
Lists components under a specific point in global, screen coordinates.

Note: this function will only return components "solid" components - components that have
some sort of a background/image, and are not transparent.

Parameters
screenX:Float
The global, on-screen x position of the point to check for components under
screenY:Float
The global, on-screen y position of the point to check for components under
type:Class<T> = null
Used to filter all components that aren't of a specific type. null by default, which means no filter is applied.

Returns
An array of all solid components that overlap the "global" position (x, y)
hasComponentUnderPoint<T>(screenX:Float, screenY:Float, type:Class<T> = null):Bool
Finds out if there is a component under a specific point in global coordinates.

Parameters
screenX:Float
The global, on-screen x position of the point to check for components under
screenY:Float
The global, on-screen y position of the point to check for components under
type:Class<T> = null
Used to filter all components that aren't of a specific type. null by default, which means no filter is applied.

Returns
true if there is a component that overlaps the global position (x, y), false otherwise.
hasSolidComponentUnderPoint<T>(screenX:Float, screenY:Float, type:Class<T> = null):Bool
Finds out if there is a solid component under a specific point in global coordinates.

Note: a solid component is a component that has
some sort of a background/image, and is not transparent.

Parameters
screenX:Float
The global, on-screen x position of the point to check for components under
screenY:Float
The global, on-screen y position of the point to check for components under
type:Class<T> = null
Used to filter all components that aren't of a specific type. null by default, which means no filter is applied.

Returns
true if there is a solid component that overlaps the global position (x, y), false otherwise.
moveComponentToFront(child:Component):Void
Moves a component to the front of the screen.

Parameters
child:Component
The component to move to the front of the screen.
registerEvent(type:String, listener:::Dynamic->Void, priority:Int = 0):Void
Adds an event listener, that listens to a certain type of event.

Parameters
type:String
The name of the event to listen to
listener:::Dynamic->Void
a function with one argument that returns nothing
priority:Int = 0
A higher value will make this event dispatch "sooner", while a lower value does the opposite.
override
removeComponent(component:Component, dispose:Bool = true):Component
Removes a component/container from the screen.

When using this via Screen.instance.removeComponent(),
This method acts as some sort of a cross-framework way
to remove components/containers from the main application's screen.

Parameters
component:Component
The component to add to the screen.

Returns
The added component.
setComponentIndex(child:Component, index:Int):Component
Sets the index of a component, essentially moving it forwards/backwards,
or, in front/behind other components.

For example, setting the index of a child of a VBox to 0 will put that child at the top of the VBox,
"behind" the rest of the children.

Parameters
child:Component
The component to move.
index:Int
The index to move that component to.

Returns
The moved component.
unregisterEvent(type:String, listener:::Dynamic->Void):Void
Removes an event listener from a specific type of event.

Parameters
type:String
The name of the event to listen to
listener:::Dynamic->Void
a function with one argument that returns nothing
invalidateAll(flag:String = InvalidationFlags.ALL):Void
refreshStyleRootComponents():Void
resizeRootComponents():Void