java.lang.Object
dev.aurumbyte.sypherengine.core.graphics.Renderer
The renderer/graphics backend, containing all the rendering helper methods
- Since:
- v0.3.0
- Author:
- AurumByte
- 
Field SummaryFieldsModifier and TypeFieldDescription(package private) javafx.scene.image.ImageThe background image to be rendered, if it is not null(package private) javafx.scene.paint.ColorDefault background color(package private) javafx.scene.canvas.CanvasThe JavaFX canvas, on which images and other stuff are rendered(package private) javafx.scene.text.FontDefault font(package private) javafx.scene.canvas.GraphicsContextThe GraphicsContext is used to render images and image tiles to the screen(package private) javafx.scene.GroupThe JavaFX group, used for adding shapes(package private) javafx.scene.SceneThe Scene on which everything is rendered
- 
Constructor SummaryConstructorsConstructorDescriptionRenderer(javafx.scene.Group group, javafx.scene.Scene scene, javafx.scene.canvas.Canvas canvas) Initializing the renderer
- 
Method SummaryModifier and TypeMethodDescriptionvoidclear()Clears all objects from the renderer queuevoiddrawCircle(Vector2 position, float radius, boolean isFilled, javafx.scene.paint.Paint paint) Drawing a circle of specified measurementsvoidDrawing a image of specified measurementsvoiddrawImageTile(ImageTile imageTile, Vector2 position, int tileX, int tileY) Drawing a image tile of specified measurementsvoidDrawing text of specified measurementsvoiddrawPolygon(double[] coords, boolean isFilled, javafx.scene.paint.Paint paint) Drawing text of specified measurementsvoiddrawRectangle(Vector2 position, float width, float height, boolean isFilled, javafx.scene.paint.Paint paint) Drawing a rectangle of specified measurementsvoiddrawText(String textContent, Vector2 position, javafx.scene.paint.Paint paint, javafx.scene.text.Font font) Drawing text of specified measurementsjavafx.scene.paint.ColorGets the background colorjavafx.scene.text.FontGets the default fontjavafx.scene.canvas.GraphicsContextGets the Graphics contextjavafx.geometry.Point2DGets the screen centervoidsetBackgroundColor(javafx.scene.paint.Color backgroundColor) Sets the Graphics contextvoidsetDefaultFont(javafx.scene.text.Font defaultFont) Sets the default fontvoidtransformContext(Entity entity) Transforms on an entity(image)
- 
Field Details- 
groupjavafx.scene.Group groupThe JavaFX group, used for adding shapes
- 
scenejavafx.scene.Scene sceneThe Scene on which everything is rendered
- 
canvasjavafx.scene.canvas.Canvas canvasThe JavaFX canvas, on which images and other stuff are rendered
- 
graphicsContextjavafx.scene.canvas.GraphicsContext graphicsContextThe GraphicsContext is used to render images and image tiles to the screen
- 
backgroundjavafx.scene.image.Image backgroundThe background image to be rendered, if it is not null
- 
backgroundColorjavafx.scene.paint.Color backgroundColorDefault background color
- 
defaultFontjavafx.scene.text.Font defaultFontDefault font
 
- 
- 
Constructor Details- 
Rendererpublic Renderer(javafx.scene.Group group, javafx.scene.Scene scene, javafx.scene.canvas.Canvas canvas) Initializing the renderer - Parameters:
- group- The group
- scene- The scene
- canvas- The canvas
- Since:
- 0.3.0
 
 
- 
- 
Method Details- 
clearpublic void clear()Clears all objects from the renderer queue - Since:
- 0.3.0
 
- 
transformContextTransforms on an entity(image) - Since:
- 0.3.0
 
- 
drawRectanglepublic void drawRectangle(Vector2 position, float width, float height, boolean isFilled, javafx.scene.paint.Paint paint) Drawing a rectangle of specified measurements - Parameters:
- position- The position of the rectangle
- width- The width of the rectangle
- height- The height of the rectangle
- isFilled- Specify whether the rectangle should be filled in or not
- paint- The Color or gradient to be filled in
- Since:
- 0.3.0
 
- 
drawCirclepublic void drawCircle(Vector2 position, float radius, boolean isFilled, javafx.scene.paint.Paint paint) Drawing a circle of specified measurements - Parameters:
- position- The position of the circle
- radius- The radius of the circle
- isFilled- Specify whether the circle should be filled in or not
- paint- The Color or gradient to be filled in
- Since:
- 0.3.0
 
- 
drawImageDrawing a image of specified measurements - Parameters:
- image- The image to be rendered
- position- The position of the image
- width- The width of the image
- height- The height of the image
- Since:
- 0.3.0
 
- 
drawImageTileDrawing a image tile of specified measurements - Parameters:
- imageTile- The image tile to be rendered
- position- The position of the image
- tileX- The tile count from left to right, starting from 0
- tileY- The tile count from the top to bottom, starting from 0
- Since:
- 0.3.0
 
- 
drawTextpublic void drawText(String textContent, Vector2 position, javafx.scene.paint.Paint paint, javafx.scene.text.Font font) Drawing text of specified measurements - Parameters:
- position- The position of the text
- textContent- The text to be rendered
- font- The font of the text
- paint- The Color or gradient to be filled in
- Since:
- 0.3.0
 
- 
drawLineDrawing text of specified measurements - Parameters:
- start- The start position of the line
- end- The end position of the line
- paint- The Color or gradient to be filled in
- Since:
- 0.3.0
 
- 
drawPolygonpublic void drawPolygon(double[] coords, boolean isFilled, javafx.scene.paint.Paint paint) Drawing text of specified measurements - Parameters:
- coords- the coordinates of the polygon vertices
- isFilled- Specify whether the polygon should be filled or not
- paint- The color or gradient to be filled in
- Since:
- 0.3.0
 
- 
getGraphicsContextpublic javafx.scene.canvas.GraphicsContext getGraphicsContext()Gets the Graphics context
- 
getBackgroundColorpublic javafx.scene.paint.Color getBackgroundColor()Gets the background color
- 
setBackgroundColorpublic void setBackgroundColor(javafx.scene.paint.Color backgroundColor) Sets the Graphics context
- 
getDefaultFontpublic javafx.scene.text.Font getDefaultFont()Gets the default font
- 
setDefaultFontpublic void setDefaultFont(javafx.scene.text.Font defaultFont) Sets the default font
- 
getScreenCenterpublic javafx.geometry.Point2D getScreenCenter()Gets the screen center
 
-