{{newin|[[0.9.1]]|091|type=function}}

{{notice|[[0.9.1]] (bug) [[Texture]]s are not released from memory automatically when nil-ing meshes. Call Mesh:setTexture() to manually clear.}}

Sets the texture ([[Image]] or [[Canvas]]) used when drawing the Mesh.

== Function ==
=== Synopsis ===
<source lang="lua">
Mesh:setTexture( texture )
</source>
=== Arguments ===
{{param|Texture|texture|The Image or Canvas to texture the Mesh with when drawing.}}
=== Returns ===
Nothing.

== Function ==
=== Synopsis ===
<source lang="lua">
Mesh:setTexture( )
</source>
=== Arguments ===
None.
=== Returns ===
Nothing.
=== Notes ===
Disables any texture from being used when drawing the Mesh. Untextured meshes have a white color by default.

== See Also ==
* [[parent::Mesh]]
* [[Mesh:getTexture]]
[[Category:Functions]]
{{#set:Description=Sets the texture ([[Image]] or [[Canvas]]) used when drawing the Mesh.}}
== Other Languages ==
{{i18n|Mesh:setTexture}}