It looks like you're new here. If you want to get involved, click one of these buttons!
function update() mesh:clearVertexArray() mesh:clearIndexArray() mesh:clearColorArray() mesh:clearTextureCoordinateArray() mesh:setVertex(1, 0, 0) mesh:setVertex(2, self.width, 0) mesh:setVertex(3, self.width, self.height) mesh:setVertex(4, 0, self.height) mesh:setTextureCoordinate(1, 0, 0) mesh:setTextureCoordinate(2, self.width, 0) mesh:setTextureCoordinate(3, self.width, self.height) mesh:setTextureCoordinate(4, 0, self.height) mesh:setIndex(1, 1) mesh:setIndex(2, 2) mesh:setIndex(3, 3) mesh:setIndex(4, 1) mesh:setIndex(5, 3) mesh:setIndex(6, 4) mesh:setColor(1, 0xff0000, 0.5) mesh:setColor(2, 0xff0000, 0.5) mesh:setColor(3, 0xff0000, 0.5) mesh:setColor(4, 0xff0000, 0.5) end |
Comments
"mesh:clearColorArray()"
as you anyway clear indices, nothing will be drawn, so you don't need to clear colors. just remember to set them when redrawing the mesh.
Likes: ar2rsawseen
Fragmenter - animated loop machine and IKONOMIKON - the memory game