Sha256: 2a73ed3f34a8a4d526bc43d39bc162fbf7295c90bfcd4d7d97557276d78921e7

Contents?: true

Size: 1.55 KB

Versions: 3

Compression:

Stored size: 1.55 KB

Contents

# Joybox - REPL Support Example
# Art By:Daniel Cook - Lost Garden http://www.lostgarden.com/2007/05/dancs-miraculously-flexible-game.html
# Authors: Joybox Swarm
# Joybox REPL Support Example
# Includes:
# => Scene & Sprites
# => REPL Support
class AppDelegate

  def application(application, didFinishLaunchingWithOptions:launchOptions)

    @director = Joybox::Configuration.setup do
      director display_stats: true
      debug repl:true
    end

    @navigation_controller = UINavigationController.alloc.initWithRootViewController(@director)
    @navigation_controller.navigationBarHidden = true

    @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
    @window.setRootViewController(@navigation_controller)
    @window.makeKeyAndVisible

    @director << GameScene.new
    true
  end

  def applicationWillResignActive(app)
    @director.pause if @navigation_controller.visibleViewController == @director
  end

  def applicationDidBecomeActive(app)
    @director.resume if @navigation_controller.visibleViewController == @director
  end

  def applicationDidEnterBackground(app)
    @director.stop_animation if @navigation_controller.visibleViewController == @director
  end

  def applicationWillEnterForeground(app)
    @director.start_animation if @navigation_controller.visibleViewController == @director
  end

  def applicationWillTerminate(app)
    @director.end
  end

  def applicationDidReceiveMemoryWarning(app)
    @director.purge_cached_data
  end

  def applicationSignificantTimeChange(app)
    @director.set_next_delta_time_zero true
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
joybox-1.1.1 template/joybox-ios-example-repl/files/app/app_delegate.rb
joybox-1.1.0 template/joybox-ios-example-repl/files/app/app_delegate.rb
joybox-1.0.0 template/joybox-ios-example-repl/files/app/app_delegate.rb