Class: Phaser::State
- Inherits:
-
Object
- Object
- Phaser::State
- Includes:
- Native
- Defined in:
- lib/opal/phaser/core/state.rb
Instance Method Summary collapse
- #create ⇒ Object
- #game ⇒ Object
- #game=(g_) ⇒ Object
-
#initialize(game = nil, &block) ⇒ State
constructor
A new instance of State.
- #preload ⇒ Object
- #render ⇒ Object
- #to_n ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(game = nil, &block) ⇒ State
Returns a new instance of State.
6 7 8 9 10 11 12 13 14 |
# File 'lib/opal/phaser/core/state.rb', line 6 def initialize(game = nil, &block) @native = `new Phaser.State` self.game = game if block_given? block.call(@game) end super(@native) end |
Instance Method Details
#create ⇒ Object
28 29 |
# File 'lib/opal/phaser/core/state.rb', line 28 def create end |
#game ⇒ Object
21 22 23 |
# File 'lib/opal/phaser/core/state.rb', line 21 def game @game end |
#game=(g_) ⇒ Object
16 17 18 19 |
# File 'lib/opal/phaser/core/state.rb', line 16 def game=(g_) @game = g_ `#@native.game = #@game` end |
#preload ⇒ Object
25 26 |
# File 'lib/opal/phaser/core/state.rb', line 25 def preload end |
#render ⇒ Object
34 35 |
# File 'lib/opal/phaser/core/state.rb', line 34 def render end |
#to_n ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/opal/phaser/core/state.rb', line 37 def to_n _preload = proc { preload } _create = proc { create } _update = proc { update } _render = proc { render } %x{ var obj = { preload: #{_preload}, create: #{_create}, update: #{_update}, render: #{_render} } } return %x{ obj } end |
#update ⇒ Object
31 32 |
# File 'lib/opal/phaser/core/state.rb', line 31 def update end |