Added skeleton RGBA tint.

This commit is contained in:
NathanSweet 2013-07-30 20:50:00 +02:00
parent 99ee8361e2
commit 59513b4afa
3 changed files with 4 additions and 3 deletions

View File

@ -134,7 +134,7 @@ function spine.Skeleton.new (skeletonData, group)
image.yScale = -image.yScale
image.rotation = -image.rotation
end
image:setFillColor(slot.r, slot.g, slot.b, slot.a)
image:setFillColor(self.r * slot.r, self.g * slot.g, self.b * slot.b, self.a * slot.a)
self.group:insert(image)
end
end

View File

@ -102,7 +102,7 @@ function spine.Skeleton.new (skeletonData, group)
yScale = -yScale
rotation = -rotation
end
love.graphics.setColor(slot.r, slot.g, slot.b, slot.a)
love.graphics.setColor(self.r * slot.r, self.g * slot.g, self.b * slot.b, self.a * slot.a)
love.graphics.draw(image,
self.x + x,
self.y - y,

View File

@ -36,7 +36,8 @@ function Skeleton.new (skeletonData)
bones = {},
slots = {},
slotsByName = {},
drawOrder = {}
drawOrder = {},
r = 1, g = 1, b = 1, a = 1
}
function self:updateWorldTransform ()