Interface GraphicsContext
public interface GraphicsContext
Represents the context of what is currently happening on the screen.
-
Method Summary
Modifier and TypeMethodDescriptionGets the current clipboard contents.intgetFps()Gets the current frames per second.Gets the last input type that was pressed.intGets the current x-coordinate of the mouse relative to Minecraft.intGets the current y-coordinate of the mouse relative to Minecraft.floatGets the current time since the last frame, in seconds.doubleGets the current x-coordinate of the mouse relative to the computer.doubleGets the current y-coordinate of the mouse relative to the computer.intGets the current height of the screen.intGets the current width of the screen.booleanGets whether the specified key is currently pressed.
-
Method Details
-
getFps
int getFps()Gets the current frames per second.- Returns:
- the fps
-
getScreenWidth
int getScreenWidth()Gets the current width of the screen.- Returns:
- the width
-
getScreenHeight
int getScreenHeight()Gets the current height of the screen.- Returns:
- the height
-
getMouseX
int getMouseX()Gets the current x-coordinate of the mouse relative to Minecraft.- Returns:
- the x-coordinate
-
getMouseY
int getMouseY()Gets the current y-coordinate of the mouse relative to Minecraft.- Returns:
- the y-coordinate
-
getRawMouseX
double getRawMouseX()Gets the current x-coordinate of the mouse relative to the computer.- Returns:
- the x-coordinate
-
getRawMouseY
double getRawMouseY()Gets the current y-coordinate of the mouse relative to the computer.- Returns:
- the y-coordinate
-
getPartialTicks
float getPartialTicks()Gets the current time since the last frame, in seconds.- Returns:
- the partial tick
-
getClipboard
Gets the current clipboard contents.- Returns:
- the clipboard, or empty string if there is none
-
getLastInputType
Gets the last input type that was pressed.- Returns:
- the last input type, or null if there was none
-
isKeyDown
Gets whether the specified key is currently pressed.- Parameters:
key- the key- Returns:
- true if the key is down, false otherwise
-