Package rekit.core
Class GameGrid
java.lang.Object
rekit.core.GameGrid
This class defines all necessary methods for drawing GameElements etc. on a
game grid
- Author:
- Dominik Fuchss, Angelo Aracri
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
drawCircle
(Vec pos, Vec size, RGBAColor color) Draw a circle.
invokesdrawCircle(Vec, Vec, RGBAColor, boolean, boolean)
and set ingame and usefilter totrue
abstract void
drawCircle
(Vec pos, Vec size, RGBAColor color, boolean ingame, boolean usefilter) Draw a circle.final void
Draw an image.void
Draw an image.abstract void
drawImage
(Vec pos, Vec size, String imagePath, boolean ingame, boolean usefilter, boolean mirrorX, boolean mirrorY) Draw an image.final void
Draw a line between two given points with line width 1px in black.final void
Draw a line between two given points with a given lineWidth in black.abstract void
Draw a line between two given points with a given lineWidth and a color.final void
abstract void
Draw a path.final void
drawPolygon
(Polygon polygon, RGBAColor color, boolean fill) abstract void
drawPolygon
(Polygon polygon, RGBAColor color, boolean fill, boolean usefilter) Draw a polygon.final void
drawRectangle
(Vec pos, Vec size, RGBAColor color) Draw a rectangle.
invokesdrawRectangle(Vec, Vec, RGBAColor, boolean, boolean)
and set ingame and usefilter totrue
abstract void
drawRectangle
(Vec pos, Vec size, RGBAColor color, boolean ingame, boolean usefilter) Draw a rectangle.final void
drawRoundRectangle
(Vec pos, Vec size, RGBAColor color, float arcWidth, float arcHeight) Draw a rectangle with round corners.
invokesdrawRoundRectangle(Vec, Vec, RGBAColor, float, float, boolean, boolean)
and set ingame and usefilter totrue
abstract void
drawRoundRectangle
(Vec pos, Vec size, RGBAColor color, float arcWidth, float arcHeight, boolean ingame, boolean usefilter) Draw a rectangle with round corners.abstract void
drawText
(Vec pos, String text, TextOptions options, boolean ingame) Draw a text element.abstract void
setCurrentOffset
(float cameraOffsetUnits) Set the current camera offset (e.g.
-
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
Draw a rectangle.
invokesdrawRectangle(Vec, Vec, RGBAColor, boolean, boolean)
and set ingame and usefilter totrue
- Parameters:
pos
- the positionsize
- the sizecolor
- 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 positionsize
- the sizecolor
- the coloringame
- indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frameusefilter
- indicates whether a filter (if set) shall applied before drawing
-
drawCircle
Draw a circle.
invokesdrawCircle(Vec, Vec, RGBAColor, boolean, boolean)
and set ingame and usefilter totrue
- Parameters:
pos
- the positionsize
- 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 positionsize
- the size (diameter)color
- the coloringame
- indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frameusefilter
- 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 lineb
- the other end point of the linelineWidth
- the line width of the linecolor
- the color of the lineingame
- indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frameusefilter
- indicates whether a filter (if set) shall applied before drawing
-
drawLine
Draw a line between two given points with a given lineWidth in black. SeedrawLine(Vec, Vec, int, RGBAColor, boolean, boolean)
for more options.- Parameters:
a
- one end point of the lineb
- the other end point of the linelineWidth
- the line width of the lineingame
- indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frameusefilter
- indicates whether a filter (if set) shall applied before drawing
-
drawLine
Draw a line between two given points with line width 1px in black. SeedrawLine(Vec, Vec, int, RGBAColor, boolean, boolean)
for more options.- Parameters:
a
- one end point of the lineb
- the other end point of the lineingame
- indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frameusefilter
- indicates whether a filter (if set) shall applied before drawing
-
drawImage
Draw an image.
invokesdrawImage(Vec, Vec, String, boolean, boolean)
and set ingame and usefilter totrue
- Parameters:
pos
- the positionsize
- the sizeimagePath
- 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 positionsize
- the sizeimagePath
- the path to the imageingame
- indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frameusefilter
- 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 positionsize
- the sizeimagePath
- the path to the imageingame
- indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frameusefilter
- indicates whether a filter (if set) shall applied before drawingmirrorX
- mirror image at X-AxismirrorY
- mirror image at Y-Axis
-
drawPolygon
- Parameters:
polygon
- the polygoncolor
- the colorfill
- 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 polygoncolor
- the colorfill
- indicates whether the polygon shall be filledusefilter
- 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 positiontext
- the textoptions
- options to customize appearanceingame
- 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.
invokesdrawRoundRectangle(Vec, Vec, RGBAColor, float, float, boolean, boolean)
and set ingame and usefilter totrue
- Parameters:
pos
- the positionsize
- the sizecolor
- the colorarcWidth
- the horizontal diameter of the arc at the four cornersarcHeight
- 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 positionsize
- the sizecolor
- the colorarcWidth
- the horizontal diameter of the arc at the four cornersarcHeight
- the vertical diameter of the arc at the four cornersingame
- indicates whether it shall drawn as entity of the game (relative to current game progress) or relative to the surrounding frameusefilter
- indicates whether a filter (if set) shall applied before drawing
-
drawPath
- Parameters:
startPos
- the start positionpts
- the following points (relative to predecessor)color
- the colorusefilter
- 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 positionpts
- the following points (relative to predecessor)color
- the colorlineWidth
- the line widthusefilter
- indicates whether a filter (if set) shall applied before drawing
-