class SK::AnimationComponent
Attributes
animations[RW]
current[RW]
Public Class Methods
new(animations)
click to toggle source
# File lib/shirokuro/standard_components/animations/animation_component.rb, line 6 def initialize animations @animations = animations @current = animations.keys.first end
Public Instance Methods
frame()
click to toggle source
# File lib/shirokuro/standard_components/animations/animation_component.rb, line 19 def frame @animations[@current].frame end
set(name)
click to toggle source
# File lib/shirokuro/standard_components/animations/animation_component.rb, line 11 def set name if name == @current return end @current = name @animations[@current].reset end
update(dt)
click to toggle source
# File lib/shirokuro/standard_components/animations/animation_component.rb, line 23 def update dt @animations[@current].update dt end