Skip to content

Commit e526d3a

Browse files
committed
merge PR NobleRobot#86: fix animation frame duration issue
1 parent 53e2331 commit e526d3a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

modules/Noble.Animation.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function Noble.Animation.new(__view)
138138
self.currentFrame = __startFrame
139139
self.current = self[__name]
140140
self.currentName = __name
141-
self.frameDuration = frameDuration
141+
self.current.frameDuration = frameDuration
142142
end
143143

144144
end
@@ -239,12 +239,12 @@ function Noble.Animation.new(__view)
239239
if (self.current.next ~= nil) then
240240
self.currentFrame = self.current.next.startFrame -- Set to first frame of next animation.
241241
self.frameDurationCount = 1 -- Reset ticks.
242-
self.previousFrameDurationCount = self.frameDuration
242+
self.previousFrameDurationCount = self.current.frameDuration
243243
self:setState(self.current.next) -- Set next animation state.
244244
elseif (self.current.loop == true) then
245245
self.currentFrame = self.current.startFrame -- Loop animation state. (TO-DO: account for continuous somehow?)
246246
self.frameDurationCount = 1 -- Reset ticks.
247-
self.previousFrameDurationCount = self.frameDuration
247+
self.previousFrameDurationCount = self.current.frameDuration
248248
elseif(__advance) then
249249
self.currentFrame = self.currentFrame - 1 -- Undo advance frame because we want to draw the same frame again.
250250
end

0 commit comments

Comments
 (0)