Package ch.epfl.cs107.play.engine.actor
Class GraphicsEntity
java.lang.Object
ch.epfl.cs107.play.engine.actor.Entity
ch.epfl.cs107.play.engine.actor.GraphicsEntity
- All Implemented Interfaces:
Acoustics,Actor,Graphics,Updatable,Positionable
GraphicEntity useful to link a single Specific Graphic type to a space point
-
Constructor Summary
ConstructorsConstructorDescriptionGraphicsEntity(Vector position, ImageGraphics graphics) Alternative GraphicsEntity ConstructorGraphicsEntity(Vector position, ShapeGraphics graphics) Alternative GraphicsEntity ConstructorGraphicsEntity(Vector position, TextGraphics graphics) Alternative GraphicsEntity Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidRenders itself on specified canvas.voidsetCurrentPosition(Vector position) Set the current position.Methods inherited from class ch.epfl.cs107.play.engine.actor.Entity
getPosition, getTransform, getVelocity
-
Constructor Details
-
GraphicsEntity
Alternative GraphicsEntity Constructor- Parameters:
position- (Vector): initial Position. Not nullgraphics- (ImageGraphics): graphics to display at position. Not null
-
GraphicsEntity
Alternative GraphicsEntity Constructor- Parameters:
position- (Vector): initial Position. Not nullgraphics- (TextGraphics): graphics to display at position. Not null
-
GraphicsEntity
Alternative GraphicsEntity Constructor- Parameters:
position- (Vector): initial Position. Not nullgraphics- (ShapeGraphics): graphics to display at position. Not null
-
-
Method Details
-
getGraphics
- Returns:
- (Graphics): The graphics of the entity
-
setCurrentPosition
Set the current position. Make public the protected method of super class- Overrides:
setCurrentPositionin classEntity- Parameters:
position- (Vector): new Position. Not null
-
draw
Description copied from interface:GraphicsRenders itself on specified canvas.- Parameters:
canvas- target, not null
-