Class: MG::Animate

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

Constructors collapse

Methods inherited from Action

#clone, #done?, #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) (defaults to: 1)

    the number of times the animation should loop. If Repeat::FOREVER (or negative value directly) was given, the animation will loop forever.



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

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