Sha256: 7134b6718f7f0c0c690d72d7e38c2035f410264478acd611a417b5ab49ddeeb3

Contents?: true

Size: 980 Bytes

Versions: 2

Compression:

Stored size: 980 Bytes

Contents

class AppDelegate
  def applicationDidFinishLaunching(notification)
    buildMenu
    buildWindow
  end

  def buildWindow
    @mainWindow = NSWindow.alloc.initWithContentRect([[240, 180], [480, 360]],
      styleMask: NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask,
      backing: NSBackingStoreBuffered,
      defer: false)
    @mainWindow.title = NSBundle.mainBundle.infoDictionary['CFBundleName']
    @mainWindow.orderFrontRegardless

    # Pick a size for the scene
    scene = MyScene.sceneWithSize(@mainWindow.frame.size)
    # Set the scale mode to scale to fit the window
    scene.scaleMode = SKSceneScaleModeAspectFit

    # create a view to sit the scene in
    view = SKView.alloc.initWithFrame(@mainWindow.frame)
    view.presentScene(scene)
    view.showsFPS = true
    view.showsNodeCount = true

    @mainWindow.setContentView(view)
  end

  def applicationShouldTerminateAfterLastWindowClosed(sender)
    true
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
motion-template-spritekit-0.4.0 template/spritekit-osx/files/app/app_delegate.rb
motion-template-spritekit-0.3.0 template/spritekit-osx/files/app/app_delegate.rb