Interface GraphicsContext


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

    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 Link icon

    • getFps Link icon

      int getFps()
      Gets the current frames per second.
      Returns:
      the fps
    • getScreenWidth Link icon

      int getScreenWidth()
      Gets the current width of the screen.
      Returns:
      the width
    • getScreenHeight Link icon

      int getScreenHeight()
      Gets the current height of the screen.
      Returns:
      the height
    • getMouseX Link icon

      int getMouseX()
      Gets the current x-coordinate of the mouse relative to Minecraft.
      Returns:
      the x-coordinate
    • getMouseY Link icon

      int getMouseY()
      Gets the current y-coordinate of the mouse relative to Minecraft.
      Returns:
      the y-coordinate
    • getRawMouseX Link icon

      double getRawMouseX()
      Gets the current x-coordinate of the mouse relative to the computer.
      Returns:
      the x-coordinate
    • getRawMouseY Link icon

      double getRawMouseY()
      Gets the current y-coordinate of the mouse relative to the computer.
      Returns:
      the y-coordinate
    • getPartialTicks Link icon

      float getPartialTicks()
      Gets the current time since the last frame, in seconds.
      Returns:
      the partial tick
    • getClipboard Link icon

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

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

      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