Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Mesh:clearColorArray() bug? — Gideros Forum

Mesh:clearColorArray() bug?

ArtiomArtiom Member
edited May 2014 in General questions
Hi!
I'm trying to draw dynamic mesh. Each frame I need to clear it from old values and set new.
If I clear vertices, uvs and indeces it's OK. When I clear colors - I can't assign colors anymore. Mesh just remains white with 1.0 alpha.
Here's the sample:
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

Sign In or Register to comment.