Interface GraphicsContext

  • All Known Implementing Classes:
    GDXRenderer, Java2DGraphicsContext, TeaGraphicsContext

    public interface GraphicsContext
    Provides access to the renderer's drawing operations. The renderer only allows drawing operations at the end of a frame updates, when the frame is rendered.

    All drawing operations use X and Y coordinates that are relative to the canvas, with the (0, 0) coordinate representing the top left corner. When drawing objects, the X and Y coordinates indicate where the object's center will be drawn. There is no explicit Z coordinate, depth ordering is based on the order in which the graphics are drawn.

    • Method Detail

      • getCanvas

        Canvas getCanvas()
      • getCanvasWidth

        default int getCanvasWidth()
      • getCanvasHeight

        default int getCanvasHeight()
      • drawBackground

        void drawBackground​(ColorRGB backgroundColor)
      • drawImage

        void drawImage​(Image image,
                       float x,
                       float y,
                       Transform transform)
      • drawSprite

        default void drawSprite​(Sprite sprite,
                                float x,
                                float y,
                                Transform transform)
      • drawText

        default void drawText​(java.lang.String text,
                              TTFont font,
                              float x,
                              float y,
                              Align align)
      • drawText

        default void drawText​(java.lang.String text,
                              TTFont font,
                              float x,
                              float y)