com.annahid.libs.artenus.graphics.sprites
LineSprite
Represents a line, and provides methods to control the appearance of the line.
public final class LineSprite extends SpriteEntity
Field Summary
Fields inherited from com.annahid.libs.artenus.graphics.sprites.SpriteEntity
Constructor Summary
Modifier and Type | Constructor and Description |
---|---|
public | LineSprite(Point2D startPoint, Point2D endPoint, float width) Creates a LineSprite connecting two given points with the
line width that is specified. |
Method Summary
Modifier and Type | Method and Description |
---|---|
public final Point2D | getEndPoint() Gets the second or end point of the line. |
public final Point2D | getStartPoint() Gets the first or starting point of the line. |
public final void | render(RenderingContext context, int flags) Renders the visual content. |
public final void | setEndPoint(float x, float y) Moves the second or end point of the line to the given coordinates. |
public final void | setLineWidth(float w) Modifies line width. |
public final void | setPoints(Point2D s, Point2D e) Moves both points of the line to the given coordinates. |
public final void | setStartPoint(float x, float y) Moves the first or starting point of the line to the given coordinates. |
Methods inherited from com.annahid.libs.artenus.graphics.sprites.SpriteEntity
advance
, getAlpha
, getAnimation
, getColorFilter
, getPosition
, getRotation
, getScale
, hasBehavior
, move
, onAttach
, onDetach
, rotate
, setAlpha
, setAnimation
, setColorFilter
, setColorFilter
, setPosition
, setPosition
, setRotation
, setScale
, setScale
Methods inherited from java.lang.Object
clone
, equals
, finalize
, getClass
, hashCode
, notify
, notifyAll
, toString
, wait
, wait
, wait
Constructor Detail
LineSprite | ||||||
---|---|---|---|---|---|---|
public LineSprite( Point2D startPoint, Point2D endPoint, float width )Creates a LineSprite connecting two given points with the line width that is specified. Parameters:
|
Method Detail
getEndPoint |
---|
public final Point2D getEndPoint() Gets the second or end point of the line. Returns:
The end point |
getStartPoint |
---|
public final Point2D getStartPoint() Gets the first or starting point of the line. Returns:
The starting point |
render |
---|
public final void render( RenderingContext context, int flags ) Renders the visual content. |
setEndPoint | ||||
---|---|---|---|---|
public final void setEndPoint( float x, float y ) Moves the second or end point of the line to the given coordinates.
This triggers internal transform updates. Parameters:
|
setLineWidth | ||
---|---|---|
public final void setLineWidth( float w ) Modifies line width. This triggers internal transform updates. Parameters:
|
setPoints | ||||
---|---|---|---|---|
public final void setPoints( Point2D s, Point2D e ) Moves both points of the line to the given coordinates.
This triggers internal transform updates. Parameters:
|
setStartPoint | ||||
---|---|---|---|---|
public final void setStartPoint( float x, float y ) Moves the first or starting point of the line to the given coordinates.
This triggers internal transform updates. Parameters:
|