new TweenPath()
Members
-
dirtyboolean
-
Used to detect if the graphics object has changed.
If this is set to true then the graphics object will be recalculated. -
readonlylengthnumber
-
The number of points along the path
-
polygonPIXI.Polygon
-
PIXI object to use as the path
Methods
-
arc(cx, cy, radius, startAngle, endAngle, anticlockwise){PIXI.tween.TweenPath}
-
The arc method creates an arc/curve (used to create circles, or parts of circles).
Name Type Default Description cxnumber The x-coordinate of the center of the circle
cynumber The y-coordinate of the center of the circle
radiusnumber The radius of the circle
startAnglenumber The starting angle, in radians (0 is at the 3 o'clock position
of the arc's circle)endAnglenumber The ending angle, in radians
anticlockwiseboolean false optional Specifies whether the drawing should be
counter-clockwise or clockwise. False is default, and indicates clockwise, while true
indicates counter-clockwise.Returns:
Type Description PIXI.tween.TweenPath - This instance of TweenPath
-
arcTo(x1, y1, x2, y2, radius){PIXI.tween.TweenPath}
-
The arcTo() method creates an arc/curve between two tangents on the canvas.
"borrowed" from https://code.google.com/p/fxcanvas/ - thanks google!
Name Type Description x1number The x-coordinate of the beginning of the arc
y1number The y-coordinate of the beginning of the arc
x2number The x-coordinate of the end of the arc
y2number The y-coordinate of the end of the arc
radiusnumber The radius of the arc
Returns:
Type Description PIXI.tween.TweenPath - This instance of TweenPath
-
bezierCurveTo(cpX, cpY, cpX2, cpY2, toX, toY){PIXI.tween.TweenPath}
-
Calculate the points for a bezier curve and then draws it.
Name Type Description cpXnumber Control point x
cpYnumber Control point y
cpX2number Second Control point x
cpY2number Second Control point y
toXnumber Destination point x
toYnumber Destination point y
Returns:
Type Description PIXI.tween.TweenPath - This instance of TweenPath
-
clear(){PIXI.tween.TweenPath}
-
Clear the path
Returns:
Type Description PIXI.tween.TweenPath - This instance of TweenPath
-
distanceBetween(num1, num2){number}
-
Finds the distance between two points
Name Type Description num1number First point
num2number Second point
Returns:
Type Description number - Distance in pixels
-
drawCircle(x, y, radius){PIXI.tween.TweenPath}
-
Draws a circle.
Name Type Description xnumber The X coordinate of the center of the circle
ynumber The Y coordinate of the center of the circle
radiusnumber The radius of the circle
Returns:
Type Description PIXI.tween.TweenPath - This instance of TweenPath
-
drawEllipse(x, y, width, height){PIXI.tween.TweenPath}
-
Draws an ellipse.
Name Type Description xnumber The X coordinate of the center of the ellipse
ynumber The Y coordinate of the center of the ellipse
widthnumber The half width of the ellipse
heightnumber The half height of the ellipse
Returns:
Type Description PIXI.tween.TweenPath - This instance of TweenPath
-
drawPolygon(path){PIXI.tween.TweenPath}
-
Draws a polygon using the given path.
Name Type Description pathArray.<number> | Array.<PIXI.Point> | PIXI.Polygon The path data used to construct the polygon.
Returns:
Type Description PIXI.tween.TweenPath - This instance of TweenPath
-
drawRect(x, y, width, height){PIXI.tween.TweenPath}
-
Draws a rectangle shape.
Name Type Description xnumber The X coord of the top-left of the rectangle
ynumber The Y coord of the top-left of the rectangle
widthnumber The width of the rectangle
heightnumber The height of the rectangle
Returns:
Type Description PIXI.tween.TweenPath - This instance of TweenPath
-
drawRoundedRect(x, y, width, height, radius){PIXI.tween.TweenPath}
-
Draw a rectangle shape with rounded/beveled corners.
Name Type Description xnumber The X coord of the top-left of the rectangle
ynumber The Y coord of the top-left of the rectangle
widthnumber The width of the rectangle
heightnumber The height of the rectangle
radiusnumber Radius of the rectangle corners
Returns:
Type Description PIXI.tween.TweenPath - This instance of TweenPath
-
drawShape(shape){PIXI.tween.TweenPath}
-
Draws the given shape to this TweenPath object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.
Name Type Description shapePIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle Shape to draw
Returns:
Type Description PIXI.tween.TweenPath - This instance of TweenPath
-
drawStar(x, y, points, radius, innerRadius, rotation){PIXI.tween.TweenPath}
-
Draw a star shape with an arbitrary number of points.
Name Type Default Description xnumber Center X position of the star
ynumber Center Y position of the star
pointsnumber The number of points of the star, must be > 1
radiusnumber The outer radius of the star
innerRadiusnumber optional The inner radius between points, default half
radiusrotationnumber 0 optional The rotation of the star in radians, where 0 is vertical
Returns:
Type Description PIXI.tween.TweenPath - This instance of TweenPath
-
getPoint(num){PIXI.Point}
-
Finds the nth point along the path
Name Type Description numnumber Point
Returns:
Type Description PIXI.Point - Point co-ordinates
-
getPointAt(num){PIXI.Point}
-
Finds the nth point along the path
Name Type Description numnumber Point
Returns:
Type Description PIXI.Point - Point co-ordinates
-
getPointAtDistance(distance){PIXI.Point}
-
Finds the nearest point for the distance to be travelled
Name Type Description distancenumber how far to travel
Returns:
Type Description PIXI.Point - Point co-ordinates
-
lineTo(x, y){PIXI.tween.TweenPath}
-
Draws a line using the current line style from the current drawing position to (x, y);
The current drawing position is then set to (x, y).Name Type Description xnumber the X coordinate to draw to
ynumber the Y coordinate to draw to
Returns:
Type Description PIXI.tween.TweenPath - This instance of TweenPath
-
moveTo(x, y){PIXI.tween.TweenPath}
-
Moves the current drawing position to x, y.
Name Type Description xnumber the X coordinate to move to
ynumber the Y coordinate to move to
Returns:
Type Description PIXI.tween.TweenPath - This instance of TweenPath
-
parsePoints(){PIXI.tween.TweenPath}
-
Parse the list of points from the path
Returns:
Type Description PIXI.tween.TweenPath - This instance of TweenPath
-
quadraticCurveTo(cpX, cpY, toX, toY){PIXI.tween.TweenPath}
-
Calculate the points for a quadratic bezier curve and then draws it.
Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-cName Type Description cpXnumber Control point x
cpYnumber Control point y
toXnumber Destination point x
toYnumber Destination point y
Returns:
Type Description PIXI.tween.TweenPath - This instance of TweenPath
-
totalDistance(){number}
-
Calculates the total distance along the entire path
Returns:
Type Description number - Distance in pixels