Class CanvasCharacter
java.lang.Object
eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape
eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractCoordinateShape
eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas.CanvasCharacter
Represents a single character on the text canvas.
-
Field Summary
Fields inherited from class eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractCoordinateShape
coordinates, onScreenZ, shapeIdFields inherited from class eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape
mouseInteractionController -
Constructor Summary
ConstructorsConstructorDescriptionCanvasCharacter(Point3D centerLocation, char character, Color foregroundColor, Color backgroundColor) Creates a canvas character at the specified location with given colors. -
Method Summary
Modifier and TypeMethodDescriptionReturns the background color of the character.static FontgetFont(int size) Returns a font of the specified size.Returns color of the foreground.voidpaint(RenderingContext renderingContext) Paints the character on the screen.voidsetBackgroundColor(Color backgroundColor) Sets the background color of the character.voidsetForegroundColor(Color foregroundColor) Sets color of the foreground.voidsetValue(char value) Sets the character value to render.Methods inherited from class eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractCoordinateShape
getZ, transformMethods inherited from class eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape
setMouseInteractionController
-
Constructor Details
-
CanvasCharacter
public CanvasCharacter(Point3D centerLocation, char character, Color foregroundColor, Color backgroundColor) Creates a canvas character at the specified location with given colors.- Parameters:
centerLocation- the center position in 3D spacecharacter- the character to renderforegroundColor- the foreground (text) colorbackgroundColor- the background color
-
-
Method Details
-
getFont
Returns a font of the specified size.If the font of the specified size is already cached, it will be returned. Otherwise, a new font will be created, cached and returned.
- Parameters:
size- the size of the font- Returns:
- the font
-
getBackgroundColor
Returns the background color of the character.- Returns:
- the background color
-
setBackgroundColor
Sets the background color of the character.- Parameters:
backgroundColor- the new background color
-
getForegroundColor
Returns color of the foreground.- Returns:
- the color
-
setForegroundColor
Sets color of the foreground.- Parameters:
foregroundColor- the color
-
paint
Paints the character on the screen.- Specified by:
paintin classAbstractCoordinateShape- Parameters:
renderingContext- the rendering context
-
setValue
public void setValue(char value) Sets the character value to render.- Parameters:
value- the new character value
-