Merge pull request #192 from reaver/master

Update Corona Runtime for the new Graphics 2.0
This commit is contained in:
Nathan Sweet 2014-05-15 18:49:06 +02:00
commit 6b7ed29684
2 changed files with 7 additions and 6 deletions

View File

@ -89,7 +89,7 @@ function spine.Skeleton.new (skeletonData, group)
updateWorldTransform_super(self)
local images = self.images
local skeletonR, skeletonG, skeletonB, skeletonA = self.r * 255, self.g * 255, self.b * 255, self.a
local skeletonR, skeletonG, skeletonB, skeletonA = self.r, self.g, self.b, self.a
for i,slot in ipairs(self.drawOrder) do
local image = images[slot]
local attachment = slot.attachment
@ -113,7 +113,8 @@ function spine.Skeleton.new (skeletonData, group)
image = self:createImage(attachment)
if image then
image.attachment = attachment
image:setReferencePoint(display.CenterReferencePoint)
image.anchorX = 0.5
image.anchorY = 0.5
image.width = attachment.width
image.height = attachment.height
else
@ -191,7 +192,7 @@ function spine.Skeleton.new (skeletonData, group)
for i,bone in ipairs(self.bones) do
if not bone.line then
bone.line = display.newLine(0, 0, bone.data.length, 0)
bone.line:setColor(255, 0, 0)
bone.line:setStrokeColor(1, 0, 0)
end
bone.line.x = bone.worldX
bone.line.y = -bone.worldY
@ -212,7 +213,7 @@ function spine.Skeleton.new (skeletonData, group)
if not bone.circle then
bone.circle = display.newCircle(0, 0, 3)
bone.circle:setFillColor(0, 255, 0)
bone.circle:setFillColor(0, 1, 0)
end
bone.circle.x = bone.worldX
bone.circle.y = -bone.worldY
@ -226,7 +227,7 @@ function spine.Skeleton.new (skeletonData, group)
self.boundsRect = display.newRect(self.group, 0, 0, 0, 0)
self.boundsRect:setFillColor(0, 0, 0, 0)
self.boundsRect.strokeWidth = 1
self.boundsRect:setStrokeColor(0, 255, 0, 255)
self.boundsRect:setStrokeColor(0, 1, 0, 1)
end
self.bounds:update(self, true)
local width = self.bounds:getWidth()

View File

@ -50,7 +50,7 @@ function AnimationStateData.new (skeletonData)
local first = self.animationToMixTime[fromName]
if not first then return self.defaultMix end
local duration = first[toName]
if not duration then return defaultMix end
if not duration then return self.defaultMix end
return duration
end