Class: Phaser::Animation

Inherits:
Object
  • Object
show all
Includes:
Native
Defined in:
lib/opal/phaser/core/animation.rb

Overview

An Animation instance contains a single animation and the controls to play it. It is created by the AnimationManager, consists of Animation.Frame objects and belongs to a single Game Object such as a Sprite.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(game, parent, name, frameData, frames, frameRate = 60, _loop = false) ⇒ Animation



18
19
20
21
# File 'lib/opal/phaser/core/animation.rb', line 18

def initialize(game, parent, name, frameData, frames, frameRate = 60, _loop = false)
  @native_game = game
  @native = `new Phaser.Animation(#@native_game, parent, name, frameData, frames, frameRate, _loop)`
end

Instance Attribute Details

#nativeObject

Returns the value of attribute native.



9
10
11
# File 'lib/opal/phaser/core/animation.rb', line 9

def native
  @native
end