motion-template-spritekit 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65dbda814d9f3782ce455143bf87263b9872c5bf
4
- data.tar.gz: 9b4b46694f2d1293fbfdf5a34ab1e56ff46447a2
3
+ metadata.gz: a9bb4ae24d66357254a37780f6d82196ef988801
4
+ data.tar.gz: 72d7e2d897efb585ec6d64e30232921f69bcc54a
5
5
  SHA512:
6
- metadata.gz: 3c088c7d299126779cc00456709e0f087570f509ba7e3f9ed1acaa421714d3e39035b5b5d5fdcb3f69fdb0def0031ab3335fa8471a099ac7bc633327871e3352
7
- data.tar.gz: 7aa4125c5f512dcfdbd6239ef8a9c92289d41728f29690162f80f2ebe9ca8010176f5114093652ddaf0425341a31e4a91f1b486a823713821230c64ecf329089
6
+ metadata.gz: 7e992763d9e220aaa65da7109ab4a333a374034ebcdb6a3b05333fde1ceb347262b02ec02b8bbf46ae363552f9eec00cdd672bf4f8a803152943bdcb0fd2fa66
7
+ data.tar.gz: 9b9aae8daf325c77d68940ce487d2f854e6109895524d70a5596e7865cada7374d7b36ec0d276ed051da2a1cec7d38fec9221008eb4e3fe755a9619ba28ec4cb
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ nbproject
15
15
  .eprj
16
16
  .sass-cache
17
17
  .idea
18
+ Gemfile.lock
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- # motion-template-spritekit [![Gem Version](https://badge.fury.io/rb/motion-template-spritekit.png)](http://badge.fury.io/rb/motion-template-spritekit)
1
+ # motion-template-spritekit
2
+ [![Gem Version](https://img.shields.io/gem/v/motion-template-spritekit.svg)](http://badge.fury.io/rb/motion-template-spritekit)
2
3
 
3
4
  SpriteKit project template for RubyMotion
4
5
 
@@ -18,6 +19,10 @@ Install it yourself as:
18
19
 
19
20
  $ motion create --template=spritekit-osx <app-name>
20
21
 
22
+ ### tvOS
23
+
24
+ $ motion create --template=spritekit-tvos <app-name>
25
+
21
26
  ## In Addition
22
27
 
23
28
  If you need original `Spaceship.png` image, please copy from your own.
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env rake
2
+ $:.unshift("/Library/RubyMotion/lib")
3
+ require "bundler/gem_tasks"
4
+ Bundler.setup
5
+ Bundler.require
@@ -3,7 +3,7 @@ require 'fileutils'
3
3
 
4
4
  dir = File.expand_path("~/Library/RubyMotion/template/")
5
5
  dir_src_templates = File.expand_path(File.join(File.dirname(__FILE__), "../template"))
6
- templates = %w(spritekit-ios spritekit-osx)
6
+ templates = %w(spritekit-ios spritekit-osx spritekit-tvos)
7
7
  templates.each do |template|
8
8
  src = File.join(dir_src_templates, template)
9
9
  dst = File.join(dir, template)
@@ -1,5 +1,5 @@
1
1
  # coding: utf-8
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "motion-template-spritekit"
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rake'
4
+ # Add your dependencies here:
@@ -0,0 +1 @@
1
+ # <%= name %>
@@ -0,0 +1,15 @@
1
+ # -*- coding: utf-8 -*-
2
+ $:.unshift("/Library/RubyMotion/lib")
3
+ require 'motion/project/template/tvos'
4
+
5
+ begin
6
+ require 'bundler'
7
+ Bundler.require
8
+ rescue LoadError
9
+ end
10
+
11
+ Motion::Project::App.setup do |app|
12
+ # Use `rake config' to see complete project settings.
13
+ app.name = '<%= name %>'
14
+ app.frameworks += ["SpriteKit"]
15
+ end
@@ -0,0 +1,9 @@
1
+ class AppDelegate
2
+ def application(application, didFinishLaunchingWithOptions:launchOptions)
3
+ scene_view = ViewController.alloc.init
4
+ @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
5
+ @window.rootViewController = scene_view
6
+ @window.makeKeyAndVisible
7
+ true
8
+ end
9
+ end
@@ -0,0 +1,29 @@
1
+ class MyScene < SKScene
2
+ def initWithSize(size)
3
+ super
4
+
5
+ self.backgroundColor = SKColor.colorWithRed(0.15, green: 0.15, blue: 0.3, alpha: 1.0)
6
+ my_label = SKLabelNode.labelNodeWithFontNamed("Chalkduster")
7
+ my_label.text = "Hello, World!"
8
+ my_label.fontSize = 30
9
+ my_label.position = CGPointMake(CGRectGetMidX(self.frame),
10
+ CGRectGetMidY(self.frame))
11
+ self.addChild(my_label)
12
+ self
13
+ end
14
+
15
+ def touchesBegan(touches, withEvent: event)
16
+ touches.each do |touch|
17
+ location = touch.locationInNode(self)
18
+ sprite = SKSpriteNode.spriteNodeWithImageNamed("Spaceship")
19
+ sprite.position = location
20
+ action = SKAction.rotateByAngle(Math::PI, duration: 1)
21
+ sprite.runAction(SKAction.repeatActionForever(action))
22
+ self.addChild(sprite)
23
+ end
24
+ end
25
+
26
+ def update(current_time)
27
+ # Called before each frame is rendered
28
+ end
29
+ end
@@ -0,0 +1 @@
1
+ SKColor = UIColor
@@ -0,0 +1,40 @@
1
+ class ViewController < UIViewController
2
+
3
+ def loadView
4
+ bounds = UIScreen.mainScreen.bounds
5
+ self.view = SKView.alloc.initWithFrame(bounds)
6
+ end
7
+
8
+ def viewDidLoad
9
+ super
10
+
11
+ # Configure the view.
12
+ sk_view = self.view
13
+ sk_view.showsFPS = true
14
+ sk_view.showsNodeCount = true
15
+
16
+ # Create and configure the scene.
17
+ scene = MyScene.sceneWithSize(sk_view.bounds.size)
18
+ scene.scaleMode = SKSceneScaleModeAspectFill
19
+
20
+ # Present the scene.
21
+ sk_view.presentScene(scene)
22
+ end
23
+
24
+ def shouldAutorotate
25
+ true
26
+ end
27
+
28
+ def supportedInterfaceOrientations
29
+ if UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPhone
30
+ UIInterfaceOrientationMaskAllButUpsideDown
31
+ else
32
+ UIInterfaceOrientationMaskAll
33
+ end
34
+ end
35
+
36
+ def didReceiveMemoryWarning
37
+ super
38
+ # Release any cached data, images, etc that aren't in use.
39
+ end
40
+ end
@@ -0,0 +1,9 @@
1
+ describe "Application '<%= name %>'" do
2
+ before do
3
+ @app = UIApplication.sharedApplication
4
+ end
5
+
6
+ it "returns fun" do
7
+ @app.should == :fun
8
+ end
9
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-template-spritekit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - meganemura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-07 00:00:00.000000000 Z
11
+ date: 2015-11-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: SpriteKit project templates for RubyMotion (iOS/OSX)
14
14
  email:
@@ -18,10 +18,11 @@ extensions:
18
18
  - ext/extconf.rb
19
19
  extra_rdoc_files: []
20
20
  files:
21
- - .gitignore
21
+ - ".gitignore"
22
22
  - Gemfile
23
23
  - LICENSE.txt
24
24
  - README.md
25
+ - Rakefile
25
26
  - ext/extconf.rb
26
27
  - motion-template-spritekit.gemspec
27
28
  - template/spritekit-ios/files/.gitignore
@@ -47,6 +48,15 @@ files:
47
48
  - template/spritekit-osx/files/resources/Credits.rtf
48
49
  - template/spritekit-osx/files/resources/Spaceship.png
49
50
  - template/spritekit-osx/files/spec/main_spec.rb.erb
51
+ - template/spritekit-tvos/files/Gemfile
52
+ - template/spritekit-tvos/files/README.md.erb
53
+ - template/spritekit-tvos/files/Rakefile.erb
54
+ - template/spritekit-tvos/files/app/app_delegate.rb
55
+ - template/spritekit-tvos/files/app/my_scene.rb
56
+ - template/spritekit-tvos/files/app/sprite_kit_base.rb
57
+ - template/spritekit-tvos/files/app/view_controller.rb
58
+ - template/spritekit-tvos/files/resources/Spaceship.png
59
+ - template/spritekit-tvos/files/spec/main_spec.rb.erb
50
60
  homepage: https://github.com/meganemura/motion-template-spritekit
51
61
  licenses:
52
62
  - MIT
@@ -57,17 +67,17 @@ require_paths:
57
67
  - lib
58
68
  required_ruby_version: !ruby/object:Gem::Requirement
59
69
  requirements:
60
- - - '>='
70
+ - - ">="
61
71
  - !ruby/object:Gem::Version
62
72
  version: '0'
63
73
  required_rubygems_version: !ruby/object:Gem::Requirement
64
74
  requirements:
65
- - - '>='
75
+ - - ">="
66
76
  - !ruby/object:Gem::Version
67
77
  version: '0'
68
78
  requirements: []
69
79
  rubyforge_project:
70
- rubygems_version: 2.0.3
80
+ rubygems_version: 2.2.2
71
81
  signing_key:
72
82
  specification_version: 4
73
83
  summary: Setup SpriteKit template to user's directory