Difference between revisions of "Mesh:hasVertexColors"

(Geometry:hasVertexColors -> Mesh:hasVertexColors)
Line 1: Line 1:
 
{{newin|[[0.9.0]]|090|type=function}}
 
{{newin|[[0.9.0]]|090|type=function}}
Retrieves if the per-vertex colors are used when rendering instead of the constant color (constant color being [[love.graphics.setColor]] or [[SpriteBatch:setColor]])
+
Gets whether per-vertex colors are used instead of the constant color when drawing the Mesh (constant color being [[love.graphics.setColor]].)
  
The per-vertex colors are automatically enabled by default when making a new [[Geometry]] or when doing [[Geometry:setVertex]], but only if at least one vertex color is not the default (255,255,255,255).
+
Per-vertex colors are enabled by default for a Mesh if at least one vertex color was not the default (255, 255, 255, 255) when the Mesh was [[love.graphics.newMesh|created]].
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
on = Geometry:hasVertexColors( )
+
vertexcolors = Mesh:hasVertexColors( )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
 
None.
 
None.
 
=== Returns ===
 
=== Returns ===
{{param|boolean|on|True to use per-vertex coloring.}}
+
{{param|boolean|vertexcolors|True if per-vertex coloring is used, otherwise [[love.graphics.setColor]] is used when drawing the Mesh.}}
 
== See Also ==
 
== See Also ==
* [[parent::Geometry]]
+
* [[parent::Mesh]]
* [[Geometry:setVertexColors]]
+
* [[Mesh:setVertexColors]]
* [[Geometry:setVertex]]
+
* [[love.graphics.newMesh]]
* [[love.graphics.setColor]]
 
* [[SpriteBatch:setColor]]
 
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=Retrieves if the per-vertex colors are used when rendering instead of the constant color.}}
+
{{#set:Description=Gets whether per-vertex colors are used when drawing the Mesh.}}
 
== Other Languages ==
 
== Other Languages ==
{{i18n|Geometry:hasVertexColors}}
+
{{i18n|Mesh:hasVertexColors}}

Revision as of 00:51, 10 October 2013

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

Gets whether per-vertex colors are used instead of the constant color when drawing the Mesh (constant color being love.graphics.setColor.)

Per-vertex colors are enabled by default for a Mesh if at least one vertex color was not the default (255, 255, 255, 255) when the Mesh was created.

Function

Synopsis

vertexcolors = Mesh:hasVertexColors( )

Arguments

None.

Returns

boolean vertexcolors
True if per-vertex coloring is used, otherwise love.graphics.setColor is used when drawing the Mesh.

See Also

Other Languages