Class BatchOverlay

  • All Implemented Interfaces:
    Overlay

    public final class BatchOverlay
    extends java.lang.Object
    implements Overlay
    Overlay implementation using Batch from libGDX.
    • Constructor Summary

      Constructors 
      Constructor Description
      BatchOverlay​(@NotNull com.badlogic.gdx.graphics.g2d.Batch batch)  
      BatchOverlay​(@NotNull com.badlogic.gdx.graphics.g2d.Batch batch, @Nullable com.badlogic.gdx.graphics.Camera camera)  
    • Constructor Detail

      • BatchOverlay

        public BatchOverlay​(@NotNull
                            @NotNull com.badlogic.gdx.graphics.g2d.Batch batch)
      • BatchOverlay

        public BatchOverlay​(@NotNull
                            @NotNull com.badlogic.gdx.graphics.g2d.Batch batch,
                            @Nullable
                            @Nullable com.badlogic.gdx.graphics.Camera camera)
    • Method Detail

      • drawLine

        @NotNull
        public @NotNull OverlayDrawing<?> drawLine​(int x1,
                                                   int y1,
                                                   int x2,
                                                   int y2,
                                                   @NotNull
                                                   @NotNull Color color)
        Description copied from interface: Overlay
        Draws line from point [x1, y1] to point [x2, y2] with color.
        Specified by:
        drawLine in interface Overlay
      • drawRectangle

        @NotNull
        public @NotNull OverlayDrawing<?> drawRectangle​(int x,
                                                        int y,
                                                        int width,
                                                        int height,
                                                        @NotNull
                                                        @NotNull Color color)
        Description copied from interface: Overlay
        Draws rectangle with bottom left corner at [x, y] of specified width and height.
        Specified by:
        drawRectangle in interface Overlay
        color - fill color.
      • drawRectangle

        @NotNull
        public @NotNull OverlayDrawing<?> drawRectangle​(int x,
                                                        int y,
                                                        int width,
                                                        int height,
                                                        @NotNull
                                                        @NotNull Color color,
                                                        float borderWidth,
                                                        @NotNull
                                                        @NotNull Color borderColor)
        Description copied from interface: Overlay
        Draws rectangle with bottom left corner at [x, y] of specified width and height.
        Specified by:
        drawRectangle in interface Overlay
        color - fill color.
        borderWidth - border line width
        borderColor - border line color
      • drawText

        @NotNull
        public @NotNull OverlayDrawing<?> drawText​(@NotNull
                                                   @NotNull java.lang.String text,
                                                   int x,
                                                   int y)
        Description copied from interface: Overlay
        Draws a text string at [x, y] with default font.
        Specified by:
        drawText in interface Overlay
      • drawText

        @NotNull
        public @NotNull OverlayDrawing<?> drawText​(@NotNull
                                                   @NotNull java.lang.String text,
                                                   int x,
                                                   int y,
                                                   @NotNull
                                                   @NotNull Font font)
        Description copied from interface: Overlay
        Draws a text string at [x, y] with font.
        Specified by:
        drawText in interface Overlay
      • drawText

        @NotNull
        public @NotNull OverlayDrawing<?> drawText​(@NotNull
                                                   @NotNull java.lang.String text,
                                                   int x,
                                                   int y,
                                                   @NotNull
                                                   @NotNull Font font,
                                                   float rotation)
        Description copied from interface: Overlay
        Draws a text string at [x, y] with font, rotated at rotation degrees.
        Specified by:
        drawText in interface Overlay
      • drawTextLayout

        @NotNull
        public @NotNull OverlayDrawing<?> drawTextLayout​(@NotNull
                                                         @NotNull TextLayout textLayout,
                                                         int x,
                                                         int y,
                                                         float rotation)
        Description copied from interface: Overlay
        Draws a pre-rendered text layout at [x, y] rotated at rotation degrees.
        Specified by:
        drawTextLayout in interface Overlay
      • drawAnimation

        @NotNull
        public @NotNull OverlayDrawing<?> drawAnimation​(@NotNull
                                                        @NotNull Animation animation,
                                                        int x,
                                                        int y)
        Description copied from interface: Overlay
        Draws animation at [x, y]. The animation is always rendered at its first frame.
        Specified by:
        drawAnimation in interface Overlay
      • drawAnimation

        @NotNull
        public @NotNull OverlayDrawing<?> drawAnimation​(@NotNull
                                                        @NotNull Animation animation,
                                                        int x,
                                                        int y,
                                                        float scale)
        Description copied from interface: Overlay
        Draws animation at [x, y], scaled at scale. The animation is always rendered at its first frame.
        Specified by:
        drawAnimation in interface Overlay
      • drawAnimation

        @NotNull
        public @NotNull OverlayDrawing<?> drawAnimation​(@NotNull
                                                        @NotNull Animation animation,
                                                        int x,
                                                        int y,
                                                        float scale,
                                                        float rotation)
        Description copied from interface: Overlay
        Draws animation at [x, y], scaled at scale and rotated at rotation degrees. The animation is always rendered at its first frame.
        Specified by:
        drawAnimation in interface Overlay
      • render

        public void render​(float deltaTime)
        Description copied from interface: Overlay
        Renders the overlay layer.
        Specified by:
        render in interface Overlay