Class GUI
java.lang.Object
com.iragui.GUI
-
Field Summary
FieldsModifier and TypeFieldDescriptionMouse cursor image used for diagonal (left) resizing.Mouse cursor image used for diagonal (right) resizing.Mouse cursor image used for horizontal resizing.boolean
Whether to log debug output to the console.Mouse cursor image used for vertical resizing. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a newGUIObject
to the GUI, registering it in name maps, layers, and event listeners.void
begin()
Initializes the GUI system, rendering the first frame and loading default mouse cursors.boolean
void
confirmLayerUpdate
(int oldLayer, GUIObject o) Moves aGUIObject
to a new layer.int
void
Prints a string to console iflogOutput
is enabled.void
Removes aGUIObject
from the GUI, unregistering it from layers and event listeners.void
render()
Renders the GUI by delegating to theWindow
.void
setBackground
(float r, float g, float b, float a) Sets the background color of theWindow
.void
Forces the next frame to be drawn.void
update()
Updates allGUIObject
s in the GUI.
-
Field Details
-
objectsByName
-
objectsByLayer
-
logOutput
public boolean logOutputWhether to log debug output to the console. -
horizontalMouse
Mouse cursor image used for horizontal resizing. -
verticalMouse
Mouse cursor image used for vertical resizing. -
diagonalLeftMouse
Mouse cursor image used for diagonal (left) resizing. -
diagonalRightMouse
Mouse cursor image used for diagonal (right) resizing.
-
-
Constructor Details
-
GUI
public GUI(String name, int sizeX, int sizeY, int displayX, int displayY, boolean resizable, boolean decorated, boolean maximized, boolean exitOnClose, boolean redrawEveryFrame, boolean nearestFilter) Constructs a newGUI
with the specified window settings.- Parameters:
name
- the window titlesizeX
- window width in pixelssizeY
- window height in pixelsdisplayX
- display scaling widthdisplayY
- display scaling heightresizable
- whether the window can be resizeddecorated
- whether the window should have decorationsmaximized
- whether the window should start maximizedexitOnClose
- whether to exit the program on window closeredrawEveryFrame
- whether to continuously redraw framesnearestFilter
- whether to use nearest-neighbor texture filtering
-
-
Method Details
-
begin
public void begin()Initializes the GUI system, rendering the first frame and loading default mouse cursors. -
update
public void update()Updates allGUIObject
s in the GUI.Determines if a new frame should be shown based on the
showFrame
andredrawEveryFrame
flags. -
showNextFrame
public void showNextFrame()Forces the next frame to be drawn. -
canShowFrame
public boolean canShowFrame()- Returns:
- whether a frame should currently be drawn
-
removeObject
-
addObject
-
confirmLayerUpdate
-
getObjectsByLayer
-
render
public void render() -
setBackground
public void setBackground(float r, float g, float b, float a) Sets the background color of theWindow
.- Parameters:
r
- red component (0–1)g
- green component (0–1)b
- blue component (0–1)a
- alpha component (0–1)
-
getWindow
-
getObjectCount
public int getObjectCount()- Returns:
- the total number of objects managed by this GUI
-
getObjectsByName
-
println
-