Artenus 2D Framework
Artenus Reference
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 TypeConstructor 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 TypeMethod and Description
public final Point2DgetEndPoint()
Gets the second or end point of the line.
public final Point2DgetStartPoint()
Gets the first or starting point of the line.
public final voidrender(RenderingContext context, int flags)
Renders the visual content.
public final voidsetEndPoint(float x, float y)
Moves the second or end point of the line to the given coordinates.
public final voidsetLineWidth(float w)
Modifies line width.
public final voidsetPoints(Point2D s, Point2D e)
Moves both points of the line to the given coordinates.
public final voidsetStartPoint(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

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:
startPointThe first point of the line
endPointThe second point of the line
widthThe line width

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:
xThe x coordinate of the new point
yThe y coordinate of the new point
setLineWidth
public final void setLineWidth(
    float w
)
Modifies line width. This triggers internal transform updates.
Parameters:
wThe new line width
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:
sThe new starting point
eThe new end point
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:
xThe x coordinate of the new point
yThe y coordinate of the new point