Class: MG::Animate

Inherits:
Action show all
Defined in:
doc/API_reference.rb

Instance Attribute Summary

Attributes inherited from Action

#done?

Constructors collapse

Methods inherited from Action

#clone, #reverse

Constructor Details

#initialize(frame_names, delay, loops = 1) ⇒ Animate

Creates an animation action where the sprite display frame will be changed to the given frames in frame_names based on the given delay and repeated loops times.

Parameters:

  • frame_names (Array<String>)

    an array of sprite frames to load and use for the animation, which can be either the names of standalone image files in the application’s resource directory or the names of sprite frames loaded from a spritesheet using Sprite.load.

  • delay (Float)

    the delay in seconds between each frame animation.

  • loops (Integer, Symbol) (defaults to: 1)

    the number of times the animation should loop. If given the :forever symbol, the animation will loop forever.



339
# File 'doc/API_reference.rb', line 339

def initialize(frame_names, delay, loops=1); end