Package rekit.core

Class GameGrid

java.lang.Object
rekit.core.GameGrid

public abstract class GameGrid extends Object
This class defines all necessary methods for drawing GameElements etc. on a game grid
Author:
Dominik Fuchss, Angelo Aracri
  • Constructor Details

    • GameGrid

      public GameGrid()
  • Method Details

    • setCurrentOffset

      public abstract void setCurrentOffset(float cameraOffsetUnits)
      Set the current camera offset (e.g. for Bosses)
      Parameters:
      cameraOffsetUnits - the camera offset in units
    • drawRectangle

      @Ingame public final void drawRectangle(Vec pos, Vec size, RGBAColor color)
      Draw a rectangle.
      invokes drawRectangle(Vec, Vec, RGBAColor, boolean, boolean) and set ingame and usefilter to true
      Parameters:
      pos - the position
      size - the size
      color - the color
    • drawRectangle

      @Ingame @NonIngame public abstract void drawRectangle(Vec pos, Vec size, RGBAColor color, boolean ingame, boolean usefilter)
      Draw a rectangle.
      Parameters:
      pos - the position
      size - the size
      color - the color
      ingame - indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frame
      usefilter - indicates whether a filter (if set) shall applied before drawing
    • drawCircle

      @Ingame public final void drawCircle(Vec pos, Vec size, RGBAColor color)
      Draw a circle.
      invokes drawCircle(Vec, Vec, RGBAColor, boolean, boolean) and set ingame and usefilter to true
      Parameters:
      pos - the position
      size - the size (diameter)
      color - the color
    • drawCircle

      @Ingame @NonIngame public abstract void drawCircle(Vec pos, Vec size, RGBAColor color, boolean ingame, boolean usefilter)
      Draw a circle.
      Parameters:
      pos - the position
      size - the size (diameter)
      color - the color
      ingame - indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frame
      usefilter - indicates whether a filter (if set) shall applied before drawing
    • drawLine

      @Ingame public abstract void drawLine(Vec a, Vec b, int lineWidth, RGBAColor color, boolean ingame, boolean usefilter)
      Draw a line between two given points with a given lineWidth and a color.
      Parameters:
      a - one end point of the line
      b - the other end point of the line
      lineWidth - the line width of the line
      color - the color of the line
      ingame - indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frame
      usefilter - indicates whether a filter (if set) shall applied before drawing
    • drawLine

      @Ingame public final void drawLine(Vec a, Vec b, int lineWidth, boolean ingame, boolean usefilter)
      Draw a line between two given points with a given lineWidth in black. See drawLine(Vec, Vec, int, RGBAColor, boolean, boolean) for more options.
      Parameters:
      a - one end point of the line
      b - the other end point of the line
      lineWidth - the line width of the line
      ingame - indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frame
      usefilter - indicates whether a filter (if set) shall applied before drawing
    • drawLine

      @Ingame public final void drawLine(Vec a, Vec b, boolean ingame, boolean usefilter)
      Draw a line between two given points with line width 1px in black. See drawLine(Vec, Vec, int, RGBAColor, boolean, boolean) for more options.
      Parameters:
      a - one end point of the line
      b - the other end point of the line
      ingame - indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frame
      usefilter - indicates whether a filter (if set) shall applied before drawing
    • drawImage

      @Ingame public final void drawImage(Vec pos, Vec size, String imagePath)
      Draw an image.
      invokes drawImage(Vec, Vec, String, boolean, boolean) and set ingame and usefilter to true
      Parameters:
      pos - the position
      size - the size
      imagePath - the path to the image
    • drawImage

      @Ingame @NonIngame public void drawImage(Vec pos, Vec size, String imagePath, boolean ingame, boolean usefilter)
      Draw an image.
      Parameters:
      pos - the position
      size - the size
      imagePath - the path to the image
      ingame - indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frame
      usefilter - indicates whether a filter (if set) shall applied before drawing
    • drawImage

      @Ingame @NonIngame public abstract void drawImage(Vec pos, Vec size, String imagePath, boolean ingame, boolean usefilter, boolean mirrorX, boolean mirrorY)
      Draw an image.
      Parameters:
      pos - the position
      size - the size
      imagePath - the path to the image
      ingame - indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frame
      usefilter - indicates whether a filter (if set) shall applied before drawing
      mirrorX - mirror image at X-Axis
      mirrorY - mirror image at Y-Axis
    • drawPolygon

      @Ingame public final void drawPolygon(Polygon polygon, RGBAColor color, boolean fill)
      Draw a polygon.
      invokes drawPolygon(Polygon, RGBAColor, boolean, boolean) and set usefilter to true
      Parameters:
      polygon - the polygon
      color - the color
      fill - indicates whether the polygon shall be filled
    • drawPolygon

      @Ingame public abstract void drawPolygon(Polygon polygon, RGBAColor color, boolean fill, boolean usefilter)
      Draw a polygon.
      Parameters:
      polygon - the polygon
      color - the color
      fill - indicates whether the polygon shall be filled
      usefilter - indicates whether a filter (if set) shall applied before drawing
    • drawText

      @Ingame @NonIngame public abstract void drawText(Vec pos, String text, TextOptions options, boolean ingame)
      Draw a text element.
      Parameters:
      pos - the position
      text - the text
      options - options to customize appearance
      ingame - indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frame
    • drawRoundRectangle

      @Ingame public final void drawRoundRectangle(Vec pos, Vec size, RGBAColor color, float arcWidth, float arcHeight)
      Draw a rectangle with round corners.
      invokes drawRoundRectangle(Vec, Vec, RGBAColor, float, float, boolean, boolean) and set ingame and usefilter to true
      Parameters:
      pos - the position
      size - the size
      color - the color
      arcWidth - the horizontal diameter of the arc at the four corners
      arcHeight - the vertical diameter of the arc at the four corners
    • drawRoundRectangle

      @Ingame @NonIngame public abstract void drawRoundRectangle(Vec pos, Vec size, RGBAColor color, float arcWidth, float arcHeight, boolean ingame, boolean usefilter)
      Draw a rectangle with round corners.
      Parameters:
      pos - the position
      size - the size
      color - the color
      arcWidth - the horizontal diameter of the arc at the four corners
      arcHeight - the vertical diameter of the arc at the four corners
      ingame - indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frame
      usefilter - indicates whether a filter (if set) shall applied before drawing
    • drawPath

      @Ingame public final void drawPath(Vec startPos, List<Vec> pts, RGBAColor color, boolean usefilter)
      Draw a path.
      invokes drawPath(Vec, List, RGBAColor, int, boolean) and set lineWidth to 1
      Parameters:
      startPos - the start position
      pts - the following points (relative to predecessor)
      color - the color
      usefilter - indicates whether a filter (if set) shall applied before drawing
    • drawPath

      @Ingame public abstract void drawPath(Vec startPos, List<Vec> pts, RGBAColor color, int lineWidth, boolean usefilter)
      Draw a path.
      Parameters:
      startPos - the start position
      pts - the following points (relative to predecessor)
      color - the color
      lineWidth - the line width
      usefilter - indicates whether a filter (if set) shall applied before drawing