mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Merge pull request #152 from scapix/master
Lua runtime - Slot and animation - color/alpha out of range fix.
This commit is contained in:
commit
fc16a47c1a
16
spine-lua/SkeletonJson.lua
Normal file → Executable file
16
spine-lua/SkeletonJson.lua
Normal file → Executable file
@ -111,10 +111,10 @@ function SkeletonJson.new (attachmentLoader)
|
||||
local color = slotMap["color"]
|
||||
if color then
|
||||
slotData:setColor(
|
||||
tonumber(color:sub(1, 2), 16),
|
||||
tonumber(color:sub(3, 4), 16),
|
||||
tonumber(color:sub(5, 6), 16),
|
||||
tonumber(color:sub(7, 8), 16)
|
||||
tonumber(color:sub(1, 2), 16)/255,
|
||||
tonumber(color:sub(3, 4), 16)/255,
|
||||
tonumber(color:sub(5, 6), 16)/255,
|
||||
tonumber(color:sub(7, 8), 16)/255
|
||||
)
|
||||
end
|
||||
|
||||
@ -264,10 +264,10 @@ function SkeletonJson.new (attachmentLoader)
|
||||
local color = valueMap["color"]
|
||||
timeline:setFrame(
|
||||
keyframeIndex, time,
|
||||
tonumber(color:sub(1, 2), 16),
|
||||
tonumber(color:sub(3, 4), 16),
|
||||
tonumber(color:sub(5, 6), 16),
|
||||
tonumber(color:sub(7, 8), 16)
|
||||
tonumber(color:sub(1, 2), 16)/255,
|
||||
tonumber(color:sub(3, 4), 16)/255,
|
||||
tonumber(color:sub(5, 6), 16)/255,
|
||||
tonumber(color:sub(7, 8), 16)/255
|
||||
)
|
||||
readCurve(timeline, keyframeIndex, valueMap)
|
||||
keyframeIndex = keyframeIndex + 1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user