Difference between revisions of "BezierCurve"

m (Functions)
Line 26: Line 26:
 
| ?PrettyRemoved
 
| ?PrettyRemoved
 
}}
 
}}
 +
 +
 +
=== Draw a bezier curve ===
 +
<source lang="lua">
 +
curve = love.math.newBezierCurve({25,25,75,50,125,25})
 +
function love.draw()
 +
love.graphics.line(curve:render())
 +
end
 +
</source>
  
 
== Supertypes ==
 
== Supertypes ==

Revision as of 14:53, 19 April 2021

Available since LÖVE 0.9.0
This type is not supported in earlier versions.

A Bézier curve object that can evaluate and render Bézier curves of arbitrary degree. For more information on Bézier curves check this great article on Wikipedia.

Constructors

love.math.newBezierCurve Creates a new BezierCurve object. Added since 0.9.0

Functions

BezierCurve:evaluate Evaluate Bézier curve at parameter t. Added since 0.9.0
BezierCurve:getControlPoint Get coordinates of the i-th control point. Added since 0.9.0
BezierCurve:getControlPointCount Get the number of control points in the Bézier curve. Added since 0.9.0
BezierCurve:getDegree Get degree of the Bézier curve. Added since 0.9.0
BezierCurve:getDerivative Get derivate of the Bézier curve. Added since 0.9.0
BezierCurve:getSegment Gets a BezierCurve that corresponds to the specified segment of this BezierCurve. Added since 0.10.0
BezierCurve:insertControlPoint Insert control point after the i-th control point. Added since 0.9.0
BezierCurve:removeControlPoint Removes the specified control point. Added since 0.10.0
BezierCurve:render Get a list of points on the curve. Added since 0.9.0
BezierCurve:renderSegment Get a list of points on a specific part of the curve. Added since 0.10.0
BezierCurve:rotate Rotate the Bézier curve. Added since 0.9.0
BezierCurve:scale Scale the Bézier curve. Added since 0.9.0
BezierCurve:setControlPoint Set coordinates of the i-th control point. Added since 0.9.0
BezierCurve:translate Move the Bézier curve. Added since 0.9.0
Object:release Immediately destroys the object's Lua reference. Added since 11.0
Object:type Gets the type of the object as a string.
Object:typeOf Checks whether an object is of a certain type.


Draw a bezier curve

curve = love.math.newBezierCurve({25,25,75,50,125,25})
function love.draw()
	love.graphics.line(curve:render())
end

Supertypes

See Also

Other Languages