Package role
Class TextModel
java.lang.Object
role.EntityModel
role.TextModel
- All Implemented Interfaces:
Configuration,Cloneable,Comparable<EntityModel>
This class represents text-based entities. The representations are in UNICODE.
The visual representation of these entities are rendered graphically.
- Author:
- Krish Pillai
-
Nested Class Summary
Nested classes/interfaces inherited from interface common.Configuration
Configuration.Direction -
Field Summary
Fields inherited from interface common.Configuration
AUDIO_DIR, DEFAULT_FRAME_RATE, DRAWABLE_DIR, GAMELOGGER, setViewCallChain -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetColor()Returns the color setting for this textvoidmodifyMessage(String message) Change the message contained in this text entity without creating a new object.Methods inherited from class role.EntityModel
clone, collidesWith, compareTo, dispose, equals, getBearingDegrees, getBearingRadians, getCoefficientOfRestitution, getCollisionBounds, getCollisionRange, getHitboxHeight, getHitboxWidth, getID, getLayer, getMass, getName, getScaleX, getScaleY, getSpeed, getTimeToLive, getX, getXAcceleration, getXLocation, getXVelocity, getY, getYAcceleration, getYLocation, getYVelocity, hashCode, isActive, isAnimated, isDisposed, isGhost, isShowBounds, isVisible, isWrappedMode, poachState, resetCollisionBounds, resetEntityState, setActive, setAnimation, setCoefficientOfRestitution, setCollisionBounds, setCollisionBounds, setGhost, setLayer, setLocation, setMass, setName, setScale, setScale, setShowBounds, setTimeToLive, setVelocityDegrees, setVelocityRadians, setVisible, setWrappedMode, setXAcceleration, setXLocation, setXVelocity, setYAcceleration, setYLocation, setYVelocity, toString
-
Constructor Details
-
TextModel
public TextModel(int x, int y) Constructor taking the coordinates of the center of the text entity. The origin is at the top left corner of the canvas.- Parameters:
x- X coordinatey- Y coordinate
-
TextModel
public TextModel(int x, int y, int layer) Constructor taking the coordinates of the center of the text entity and the layer for z-axis. The origin is at the top left corner of the canvas. Lower layer numbers are overlaid by higher ones.- Parameters:
x- X coordinatey- Y coordinatelayer- The layer number [greater than or equal to zero]
-
-
Method Details
-
getColor
Returns the color setting for this text- Returns:
- the current color
-
modifyMessage
Change the message contained in this text entity without creating a new object. This call will generate a new view for the entity.- Parameters:
message- the new message to be displayed
-