Package xyz.gmitch215.socketmc.retriever
Class Window
java.lang.Object
xyz.gmitch215.socketmc.retriever.Window
- All Implemented Interfaces:
Serializable
Utility class to represent the client's window information.
- See Also:
-
Constructor Summary
ConstructorDescriptionWindow()
Creates a new, empty window.Window
(long id, boolean fullscreen, int x, int y, int width, int height, int screenWidth, int screenHeight, int guiScaledWidth, int guiScaledHeight, double guiScale, int framerateLimit, String platform, int refreshRate) Creates a new window with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the framerate limit of the window.double
Gets the GUI scale of the window.int
Gets the height of the window, scaled by the GUI.int
Gets the width of the window, scaled by the GUI.int
Gets the height of the window.long
getId()
Gets the window ID.Gets the platform this window is currently using.int
Gets the refresh rate (in Hz) for the window.int
Gets the height of the screen.int
Gets the width of the screen.int
getWidth()
Gets the width of the window.int
getX()
Gets the x position of the window.int
getY()
Gets the y position of the window.boolean
Gets whether the window is in fullscreen mode.
-
Constructor Details
-
Window
public Window()Creates a new, empty window. -
Window
public Window(long id, boolean fullscreen, int x, int y, int width, int height, int screenWidth, int screenHeight, int guiScaledWidth, int guiScaledHeight, double guiScale, int framerateLimit, String platform, int refreshRate) Creates a new window with the specified parameters.- Parameters:
id
- Window IDfullscreen
- Fullscreen Modex
- X Positiony
- Y Positionwidth
- Widthheight
- HeightscreenWidth
- Screen WidthscreenHeight
- Screen HeightguiScaledWidth
- GUI Scaled WidthguiScaledHeight
- GUI Scaled HeightguiScale
- GUI ScaleframerateLimit
- Framerate Limitplatform
- Window PlatformrefreshRate
- Refresh Rate
-
-
Method Details
-
getId
public long getId()Gets the window ID.- Returns:
- Window ID
-
isFullscreen
public boolean isFullscreen()Gets whether the window is in fullscreen mode.- Returns:
- True if the window is in fullscreen mode, false otherwise.
-
getX
public int getX()Gets the x position of the window.- Returns:
- Window X Position
-
getY
public int getY()Gets the y position of the window.- Returns:
- Window Y Position
-
getWidth
public int getWidth()Gets the width of the window.- Returns:
- Window Width
-
getHeight
public int getHeight()Gets the height of the window.- Returns:
- Window Height
-
getScreenWidth
public int getScreenWidth()Gets the width of the screen.- Returns:
- Screen Width
-
getScreenHeight
public int getScreenHeight()Gets the height of the screen.- Returns:
- Screen Height
-
getGuiScaledWidth
public int getGuiScaledWidth()Gets the width of the window, scaled by the GUI.- Returns:
- GUI Scaled Width
-
getGuiScaledHeight
public int getGuiScaledHeight()Gets the height of the window, scaled by the GUI.- Returns:
- GUI Scaled Height
-
getGuiScale
public double getGuiScale()Gets the GUI scale of the window.- Returns:
- GUI Scale
-
getFramerateLimit
public int getFramerateLimit()Gets the framerate limit of the window.- Returns:
- Framerate Limit
-
getPlatform
Gets the platform this window is currently using.
Some potential values are:
win32
if on Windowscocoa
if on macOSx11
orwayland
if on Unixnull
if inaccessible<error>
if can't fetch the valueunknown
if not using a generally known windows API
- Returns:
- Window Platform
-
getRefreshRate
public int getRefreshRate()Gets the refresh rate (in Hz) for the window.- Returns:
- Refresh Rate
-