Class Window
-
- All Implemented Interfaces:
public abstract class WindowThis class represents the physical window that PolyUI will render to. As a window implementation, you must:
implement these methods
call PolyUI.resize when the window is resized
call PolyUI.render every frame, inside a rendering loop started with open. It may be blocking or non-blocking.
callbacks for InputManager.mousePressed
callbacks for InputManager.mouseReleased
callbacks for InputManager.mouseMoved
callbacks for InputManager.mouseScrolled
callbacks for InputManager.keyDown
callbacks for InputManager.keyUp
callbacks for InputManager.keyTyped
callbacks for InputManager.filesDropped
-
-
Method Summary
Modifier and Type Method Description IntegergetWidth()UnitsetWidth(Integer width)IntegergetHeight()UnitsetHeight(Integer height)FloatgetPixelRatio()UnitsetPixelRatio(Float pixelRatio)abstract Windowopen(PolyUI polyUI)open the window with the specified PolyUI instance, and then start the rendering loop. abstract Unitclose()destroy the window. UnitpreRender(Renderer renderer)this function hooks into the rendering loop. UnitpostRender(Renderer renderer)this function hooks into the rendering loop. abstract BooleansupportsRenderPausing()Return true if your window supports "render pausing", an optimization technique which will not render any frames if not necessary. abstract UnitbreakPause()This function may be called by the PolyUI instance when it has something that it wants to do immediately. abstract StringgetClipboard()Get the clipboard string. abstract UnitsetClipboard(String text)Set the clipboard string. abstract UnitsetCursor(Cursor cursor)Set the cursor design. abstract StringgetKeyName(Integer key)Return the name of a key that is not mapped by PolyUI. -
-
Method Detail
-
getPixelRatio
Float getPixelRatio()
-
setPixelRatio
Unit setPixelRatio(Float pixelRatio)
-
open
abstract Window open(PolyUI polyUI)
open the window with the specified PolyUI instance, and then start the rendering loop. It may be blocking or non-blocking. Every frame, call the PolyUI.render function to render the UI.
-
preRender
Unit preRender(Renderer renderer)
this function hooks into the rendering loop. it is ran before a render cycle.
- Since:
1.1.3
-
postRender
Unit postRender(Renderer renderer)
this function hooks into the rendering loop. it is ran after a render cycle.
- Since:
1.1.3
-
supportsRenderPausing
abstract Boolean supportsRenderPausing()
Return true if your window supports "render pausing", an optimization technique which will not render any frames if not necessary.
See Settings.renderPausing for a better explanation.
- Since:
0.25.1
-
breakPause
abstract Unit breakPause()
This function may be called by the PolyUI instance when it has something that it wants to do immediately.
You can ignore this function if you do not support render pausing.
- Since:
1.5.0
-
getClipboard
abstract String getClipboard()
Get the clipboard string. This is used for the org.polyfrost.polyui.component.impl.TextInput class.
If the data is empty or not a string, then null is returned.
-
setClipboard
abstract Unit setClipboard(String text)
Set the clipboard string. This is used for the org.polyfrost.polyui.component.impl.TextInput class.
-
getKeyName
abstract String getKeyName(Integer key)
Return the name of a key that is not mapped by PolyUI.
-
-
-
-