mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 02:06:03 +08:00
fix some screwups and formatting, restore find-functions
This commit is contained in:
parent
3a0ba4a70a
commit
1ea5aa54f0
@ -371,11 +371,11 @@ function Animation.ColorTimeline.new ()
|
|||||||
local g = lastFrameG + (frames[frameIndex + FRAME_G] - lastFrameG) * percent
|
local g = lastFrameG + (frames[frameIndex + FRAME_G] - lastFrameG) * percent
|
||||||
local b = lastFrameB + (frames[frameIndex + FRAME_B] - lastFrameB) * percent
|
local b = lastFrameB + (frames[frameIndex + FRAME_B] - lastFrameB) * percent
|
||||||
local a = lastFrameA + (frames[frameIndex + FRAME_A] - lastFrameA) * percent
|
local a = lastFrameA + (frames[frameIndex + FRAME_A] - lastFrameA) * percent
|
||||||
--if alpha < 1 then
|
if alpha < 1 then
|
||||||
-- slot:setColor(slot.r + (r - color.r) * alpha, slot.g + (g - color.g) * alpha, slot.b + (b - color.b) * alpha, slot.a + (a - color.a) * alpha)
|
slot:setColor(slot.r + (r - slot.r) * alpha, slot.g + (g - slot.g) * alpha, slot.b + (b - slot.b) * alpha, slot.a + (a - slot.a) * alpha)
|
||||||
--else
|
else
|
||||||
slot:setColor(r, g, b, a)
|
slot:setColor(r, g, b, a)
|
||||||
--end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|||||||
@ -74,6 +74,11 @@ function Skeleton.new (skeletonData)
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function self:findSlot (slotName)
|
||||||
|
if not slotName then error("slotName cannot be nil.", 2) end
|
||||||
|
return slotsByName[slotName]
|
||||||
|
end
|
||||||
|
|
||||||
function self:setSkin (skinName)
|
function self:setSkin (skinName)
|
||||||
local newSkin
|
local newSkin
|
||||||
if skinName then
|
if skinName then
|
||||||
|
|||||||
@ -57,6 +57,11 @@ function SkeletonData.new ()
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function self:findSlotIndex (slotName)
|
||||||
|
if not slotName then error("slotName cannot be nil.", 2) end
|
||||||
|
return slotNameIndices[slotName] or -1
|
||||||
|
end
|
||||||
|
|
||||||
function self:findSkin (skinName)
|
function self:findSkin (skinName)
|
||||||
if not skinName then error("skinName cannot be nil.", 2) end
|
if not skinName then error("skinName cannot be nil.", 2) end
|
||||||
for i,skin in ipairs(self.skins) do
|
for i,skin in ipairs(self.skins) do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user