Difference between revisions of "BezierCurve"
m (add parent:: in supertypes) |
m (Cleanup.) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{newin|[[0.9.0]]|090|type=type}} | {{newin|[[0.9.0]]|090|type=type}} | ||
A Bézier curve object that can evaluate and render Bézier curves of arbitrary degree. | A Bézier curve object that can evaluate and render Bézier curves of arbitrary degree. | ||
− | For more information on Bézier curves check [ | + | For more information on Bézier curves check [https://en.wikipedia.org/wiki/B%C3%A9zier_curve this great article on Wikipedia]. |
== Constructors == | == Constructors == | ||
Line 16: | Line 16: | ||
}} | }} | ||
== Functions == | == Functions == | ||
− | {{#ask: [[Category:Functions]] [[parent::BezierCurve||Object]] | + | {{#ask: [[Category:Functions]] [[parent::BezierCurve||Object]] [[Concept:Current]] |
| headers=hide | | headers=hide | ||
| format=template | | format=template | ||
Line 26: | Line 26: | ||
| ?PrettyRemoved | | ?PrettyRemoved | ||
}} | }} | ||
+ | |||
== Supertypes == | == Supertypes == | ||
* [[parent::Object]] | * [[parent::Object]] | ||
+ | |||
+ | == Examples == | ||
+ | === Draw a Bézier curve === | ||
+ | <source lang="lua"> | ||
+ | local curve = love.math.newBezierCurve({25,25, 25,125, 75,25, 125,25}) | ||
+ | function love.draw() | ||
+ | love.graphics.line(curve:render()) | ||
+ | end | ||
+ | </source> | ||
+ | |||
== See Also == | == See Also == | ||
* [[parent::love.math]] | * [[parent::love.math]] | ||
[[Category:Types]] | [[Category:Types]] | ||
{{#set:Description=A Bézier curve object that can evaluate and render Bézier curves of arbitrary degree.}} | {{#set:Description=A Bézier curve object that can evaluate and render Bézier curves of arbitrary degree.}} | ||
+ | |||
== Other Languages == | == Other Languages == | ||
{{i18n|BezierCurve}} | {{i18n|BezierCurve}} |
Latest revision as of 08:35, 23 November 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.
Contents
Constructors
love.math.newBezierCurve | Creates a new BezierCurve object. | 0.9.0 |
Functions
BezierCurve:evaluate | Evaluate Bézier curve at parameter t. | 0.9.0 | |
BezierCurve:getControlPoint | Get coordinates of the i-th control point. | 0.9.0 | |
BezierCurve:getControlPointCount | Get the number of control points in the Bézier curve. | 0.9.0 | |
BezierCurve:getDegree | Get degree of the Bézier curve. | 0.9.0 | |
BezierCurve:getDerivative | Get derivate of the Bézier curve. | 0.9.0 | |
BezierCurve:getSegment | Gets a BezierCurve that corresponds to the specified segment of this BezierCurve. | 0.10.0 | |
BezierCurve:insertControlPoint | Insert control point after the i-th control point. | 0.9.0 | |
BezierCurve:removeControlPoint | Removes the specified control point. | 0.10.0 | |
BezierCurve:render | Get a list of points on the curve. | 0.9.0 | |
BezierCurve:renderSegment | Get a list of points on a specific part of the curve. | 0.10.0 | |
BezierCurve:rotate | Rotate the Bézier curve. | 0.9.0 | |
BezierCurve:scale | Scale the Bézier curve. | 0.9.0 | |
BezierCurve:setControlPoint | Set coordinates of the i-th control point. | 0.9.0 | |
BezierCurve:translate | Move the Bézier curve. | 0.9.0 | |
Object:release | Immediately destroys the object's Lua reference. | 11.0 | |
Object:type | Gets the type of the object as a string. | ||
Object:typeOf | Checks whether an object is of a certain type. |
Supertypes
Examples
Draw a Bézier curve
local curve = love.math.newBezierCurve({25,25, 25,125, 75,25, 125,25})
function love.draw()
love.graphics.line(curve:render())
end
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info