Interface GraphicsContext


public interface GraphicsContext
Represents the context of what is currently happening on the screen.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the current clipboard contents.
    int
    Gets the current frames per second.
    Gets the last input type that was pressed.
    int
    Gets the current x-coordinate of the mouse relative to Minecraft.
    int
    Gets the current y-coordinate of the mouse relative to Minecraft.
    float
    Gets the current time since the last frame, in seconds.
    double
    Gets the current x-coordinate of the mouse relative to the computer.
    double
    Gets the current y-coordinate of the mouse relative to the computer.
    int
    Gets the current height of the screen.
    int
    Gets the current width of the screen.
    boolean
    Gets 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

      @NotNull @NotNull String getClipboard()
      Gets the current clipboard contents.
      Returns:
      the clipboard, or empty string if there is none
    • getLastInputType

      @Nullable @Nullable InputType getLastInputType()
      Gets the last input type that was pressed.
      Returns:
      the last input type, or null if there was none
    • isKeyDown

      boolean isKeyDown(@Nullable @Nullable Key key)
      Gets whether the specified key is currently pressed.
      Parameters:
      key - the key
      Returns:
      true if the key is down, false otherwise