Class: Engine::Components::SpriteAnimator
- Inherits:
-
Engine::Component
- Object
- Engine::Component
- Engine::Components::SpriteAnimator
- Defined in:
- lib/engine/components/sprite_animator.rb
Instance Attribute Summary collapse
-
#frame_rate ⇒ Object
readonly
Returns the value of attribute frame_rate.
-
#loop ⇒ Object
readonly
Returns the value of attribute loop.
Attributes inherited from Engine::Component
Instance Method Summary collapse
Methods inherited from Engine::Component
#_erase!, #destroy, #destroy!, #destroyed?, destroyed_components, erase_destroyed_components, method_added, #renderer?, #set_game_object, #ui_renderer?
Methods included from Serializable
allowed_class?, get_class, included, register_class, #uuid
Instance Attribute Details
#frame_rate ⇒ Object (readonly)
Returns the value of attribute frame_rate.
7 8 9 |
# File 'lib/engine/components/sprite_animator.rb', line 7 def frame_rate @frame_rate end |
#loop ⇒ Object (readonly)
Returns the value of attribute loop.
7 8 9 |
# File 'lib/engine/components/sprite_animator.rb', line 7 def loop @loop end |
Instance Method Details
#awake ⇒ Object
9 10 11 12 |
# File 'lib/engine/components/sprite_animator.rb', line 9 def awake @frame_rate ||= 1 @loop = true if @loop.nil? end |
#start ⇒ Object
14 15 16 17 |
# File 'lib/engine/components/sprite_animator.rb', line 14 def start @start_time = Time.now update_frame end |
#update(delta_time) ⇒ Object
19 20 21 |
# File 'lib/engine/components/sprite_animator.rb', line 19 def update(delta_time) update_frame end |