Difference between revisions of "Mesh:getVertexFormat"
(Created page) |
m |
||
(One intermediate revision by one other user not shown) | |||
Line 10: | Line 10: | ||
None. | None. | ||
=== Returns === | === Returns === | ||
− | {{param|table|format|The vertex format of the Mesh, which is a table containing tables for each vertex attribute the Mesh was created with, in the form of <code>{attribute, | + | {{param|table|format|The vertex format of the Mesh, which is a table containing tables for each vertex attribute the Mesh was created with, in the form of <code>{attribute, ...}</code>.}} |
{{subparam|table|attribute|A table containing the attribute's name, it's [[AttributeDataType|data type]], and the number of components in the attribute, in the form of <code>{name, datatype, components}</code>.}} | {{subparam|table|attribute|A table containing the attribute's name, it's [[AttributeDataType|data type]], and the number of components in the attribute, in the form of <code>{name, datatype, components}</code>.}} | ||
{{subparam|table|...|Additional vertex attributes in the Mesh.}} | {{subparam|table|...|Additional vertex attributes in the Mesh.}} | ||
Line 18: | Line 18: | ||
<source lang="lua"> | <source lang="lua"> | ||
defaultformat = { | defaultformat = { | ||
− | {"VertexPosition", "float", | + | {"VertexPosition", "float", 2}, -- The x,y position of each vertex. |
− | {"VertexTexCoord", "float", 2}, | + | {"VertexTexCoord", "float", 2}, -- The u,v texture coordinates of each vertex. |
− | {"VertexColor", "byte", 4} | + | {"VertexColor", "byte", 4} -- The r,g,b,a color of each vertex. |
} | } | ||
</source> | </source> |
Latest revision as of 08:17, 18 December 2015
Available since LÖVE 0.10.0 |
This function is not supported in earlier versions. |
Gets the vertex format that the Mesh was created with.
Function
Synopsis
format = Mesh:getVertexFormat( )
Arguments
None.
Returns
table format
- The vertex format of the Mesh, which is a table containing tables for each vertex attribute the Mesh was created with, in the form of
{attribute, ...}
.
Notes
If a Mesh wasn't created with a custom vertex format, it will have the following vertex format:
defaultformat = {
{"VertexPosition", "float", 2}, -- The x,y position of each vertex.
{"VertexTexCoord", "float", 2}, -- The u,v texture coordinates of each vertex.
{"VertexColor", "byte", 4} -- The r,g,b,a color of each vertex.
}
See Also
- Mesh
- love.graphics.newMesh
- AttributeDataType
- Mesh:setVertex
- Mesh:setVertexAttribute
- love.graphics.draw
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