Difference between revisions of "Mesh:getVertex"
m (moved Geometry:getVertex to Mesh:getVertex) |
(Updated for 11.0) |
||
(8 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{newin|[[0.9.0]]|090|type=function}} | {{newin|[[0.9.0]]|090|type=function}} | ||
− | + | Gets the properties of a vertex in the Mesh. | |
+ | In versions prior to [[11.0]], color and byte component values were within the range of 0 to 255 instead of 0 to 1. | ||
== Function == | == Function == | ||
+ | {{newin|[[0.10.0]]|100|type=variant}} | ||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | + | attributecomponent, ... = Mesh:getVertex( index ) | |
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
− | {{param|number| | + | {{param|number|index|The one-based index of the vertex you want to retrieve the information for.}} |
=== Returns === | === Returns === | ||
− | {{param|number|x|The x vertex | + | {{param|number|attributecomponent|The first component of the first vertex attribute in the specified vertex.}} |
− | {{param|number|y|The y | + | {{param|number|...|Additional components of all vertex attributes in the specified vertex.}} |
− | {{param|number|u|The | + | === Notes === |
− | {{param|number|v|The | + | The values are returned in the same order as the vertex attributes in the Mesh's [[Mesh:getVertexFormat|vertex format]]. A standard Mesh that wasn't [[love.graphics.newMesh|created]] with a custom vertex format will return two position numbers, two texture coordinate numbers, and four color components: x, y, u, v, r, g, b, a. |
− | {{param|number|r|The red color | + | |
− | {{param|number|g|The green color | + | == Function == |
− | {{param|number|b|The blue color | + | Gets the vertex components of a Mesh that wasn't [[love.graphics.newMesh|created]] with a custom vertex format. |
− | {{param|number|a|The alpha color | + | === Synopsis === |
+ | <source lang="lua"> | ||
+ | x, y, u, v, r, g, b, a = Mesh:getVertex( index ) | ||
+ | </source> | ||
+ | === Arguments === | ||
+ | {{param|number|index|The index of the vertex you want to retrieve the information for.}} | ||
+ | === Returns === | ||
+ | {{param|number|x|The position of the vertex on the x-axis.}} | ||
+ | {{param|number|y|The position of the vertex on the y-axis.}} | ||
+ | {{param|number|u|The horizontal component of the texture coordinate.}} | ||
+ | {{param|number|v|The vertical component of the texture coordinate.}} | ||
+ | {{param|number|r|The red component of the vertex's color.}} | ||
+ | {{param|number|g|The green component of the vertex's color.}} | ||
+ | {{param|number|b|The blue component of the vertex's color.}} | ||
+ | {{param|number|a|The alpha component of the vertex's color.}} | ||
+ | |||
== See Also == | == See Also == | ||
− | * [[parent:: | + | * [[parent::Mesh]] |
− | * [[ | + | * [[Mesh:setVertex]] |
+ | * [[Mesh:getVertexCount]] | ||
+ | * [[Mesh:getVertexAttribute]] | ||
+ | * [[Mesh:getVertexFormat]] | ||
+ | * [[love.graphics.newMesh]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | {{#set:Description= | + | {{#set:Description=Gets the properties of a vertex in the Mesh.}} |
+ | |||
== Other Languages == | == Other Languages == | ||
− | {{i18n| | + | {{i18n|Mesh:getVertex}} |
Latest revision as of 20:23, 1 April 2018
Available since LÖVE 0.9.0 |
This function is not supported in earlier versions. |
Gets the properties of a vertex in the Mesh.
In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.
Contents
Function
Available since LÖVE 0.10.0 |
This variant is not supported in earlier versions. |
Synopsis
attributecomponent, ... = Mesh:getVertex( index )
Arguments
number index
- The one-based index of the vertex you want to retrieve the information for.
Returns
number attributecomponent
- The first component of the first vertex attribute in the specified vertex.
number ...
- Additional components of all vertex attributes in the specified vertex.
Notes
The values are returned in the same order as the vertex attributes in the Mesh's vertex format. A standard Mesh that wasn't created with a custom vertex format will return two position numbers, two texture coordinate numbers, and four color components: x, y, u, v, r, g, b, a.
Function
Gets the vertex components of a Mesh that wasn't created with a custom vertex format.
Synopsis
x, y, u, v, r, g, b, a = Mesh:getVertex( index )
Arguments
number index
- The index of the vertex you want to retrieve the information for.
Returns
number x
- The position of the vertex on the x-axis.
number y
- The position of the vertex on the y-axis.
number u
- The horizontal component of the texture coordinate.
number v
- The vertical component of the texture coordinate.
number r
- The red component of the vertex's color.
number g
- The green component of the vertex's color.
number b
- The blue component of the vertex's color.
number a
- The alpha component of the vertex's color.
See Also
- Mesh
- Mesh:setVertex
- Mesh:getVertexCount
- Mesh:getVertexAttribute
- Mesh:getVertexFormat
- love.graphics.newMesh
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