Interface GuiView
- All Known Subinterfaces:
EditorView
public interface GuiView
Something that draws and takes input, in GUI-scaled pixels. Input handlers return whether
they used the event.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleandefault booleancharTyped(GuiCharEvent event) default voidclosed()Called once when the view goes away.default booleanCalled when the GUI is asked to close.default RectWhere open editors go, read every frame.default booleankeyPressed(GuiKeyEvent event) default booleankeyReleased(GuiKeyEvent event) default booleanmouseClicked(GuiMouseEvent event) default booleanmouseDragged(GuiDragEvent event) default booleanmouseReleased(GuiMouseEvent event) default booleanmouseScrolled(GuiScrollEvent event) default floatopacity()default voidopened()Called once before the first frame.voidDraws one frame.default voidresized(double width, double height) Called when the window's GUI-scaled size changes.
-
Method Details
-
render
-
mouseClicked
-
mouseReleased
-
mouseDragged
-
mouseScrolled
-
keyPressed
-
keyReleased
-
charTyped
-
opened
default void opened()Called once before the first frame. -
closed
default void closed()Called once when the view goes away. -
resized
default void resized(double width, double height) Called when the window's GUI-scaled size changes.- Parameters:
width- New widthheight- New height
-
closeRequested
default boolean closeRequested()Called when the GUI is asked to close.- Returns:
- True to run an exit animation and call
GuiSession.finishClose()when it is done, false to close at once
-
capturesKeyboard
default boolean capturesKeyboard()- Returns:
- Whether typing goes to this view, which keeps movement keys and binds from acting while the GUI is open
-
opacity
default float opacity()- Returns:
- How opaque the view is right now, 0 to 1, for example while it fades in or out. Open editors are drawn at this opacity too, so they fade with the view.
-
editorArea
Where open editors go, read every frame. By default they float over the whole screen and the view is out of reach until they close: a click outside every editor closes the newest.
With an area, editors are placed in it by the theme'sEditorLayoutand the view keeps working around them. Clicks outside the editors reach the view, and editors close only when they close themselves, on Escape, or when the view closes them.- Returns:
- The area in GUI-scaled pixels, or null for the whole screen
-