cyberarm_engine 0.19.0 → 0.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +8 -8
  3. data/.rubocop.yml +7 -7
  4. data/.travis.yml +5 -5
  5. data/Gemfile +6 -6
  6. data/LICENSE.txt +21 -21
  7. data/README.md +74 -74
  8. data/Rakefile +10 -10
  9. data/bin/console +14 -14
  10. data/bin/setup +8 -8
  11. data/cyberarm_engine.gemspec +39 -39
  12. data/lib/cyberarm_engine/animator.rb +219 -219
  13. data/lib/cyberarm_engine/background.rb +179 -179
  14. data/lib/cyberarm_engine/background_nine_slice.rb +142 -142
  15. data/lib/cyberarm_engine/bounding_box.rb +150 -150
  16. data/lib/cyberarm_engine/builtin/intro_state.rb +130 -130
  17. data/lib/cyberarm_engine/cache/download_manager.rb +121 -121
  18. data/lib/cyberarm_engine/cache.rb +4 -4
  19. data/lib/cyberarm_engine/common.rb +113 -113
  20. data/lib/cyberarm_engine/config_file.rb +46 -46
  21. data/lib/cyberarm_engine/console/command.rb +157 -157
  22. data/lib/cyberarm_engine/console/commands/help_command.rb +43 -43
  23. data/lib/cyberarm_engine/console/subcommand.rb +99 -99
  24. data/lib/cyberarm_engine/console.rb +248 -248
  25. data/lib/cyberarm_engine/game_object.rb +248 -248
  26. data/lib/cyberarm_engine/game_state.rb +97 -97
  27. data/lib/cyberarm_engine/model/material.rb +21 -21
  28. data/lib/cyberarm_engine/model/model_object.rb +131 -131
  29. data/lib/cyberarm_engine/model/parser.rb +74 -74
  30. data/lib/cyberarm_engine/model/parsers/collada_parser.rb +138 -138
  31. data/lib/cyberarm_engine/model/parsers/wavefront_parser.rb +154 -154
  32. data/lib/cyberarm_engine/model.rb +212 -212
  33. data/lib/cyberarm_engine/model_cache.rb +31 -31
  34. data/lib/cyberarm_engine/opengl/light.rb +50 -50
  35. data/lib/cyberarm_engine/opengl/orthographic_camera.rb +46 -46
  36. data/lib/cyberarm_engine/opengl/perspective_camera.rb +38 -38
  37. data/lib/cyberarm_engine/opengl/renderer/bounding_box_renderer.rb +249 -249
  38. data/lib/cyberarm_engine/opengl/renderer/g_buffer.rb +164 -164
  39. data/lib/cyberarm_engine/opengl/renderer/opengl_renderer.rb +298 -298
  40. data/lib/cyberarm_engine/opengl/renderer/renderer.rb +22 -22
  41. data/lib/cyberarm_engine/opengl/shader.rb +406 -406
  42. data/lib/cyberarm_engine/opengl/texture.rb +69 -69
  43. data/lib/cyberarm_engine/opengl.rb +28 -28
  44. data/lib/cyberarm_engine/ray.rb +56 -56
  45. data/lib/cyberarm_engine/stats.rb +21 -21
  46. data/lib/cyberarm_engine/text.rb +197 -197
  47. data/lib/cyberarm_engine/timer.rb +23 -23
  48. data/lib/cyberarm_engine/transform.rb +296 -296
  49. data/lib/cyberarm_engine/ui/border_canvas.rb +102 -102
  50. data/lib/cyberarm_engine/ui/dsl.rb +139 -139
  51. data/lib/cyberarm_engine/ui/element.rb +488 -488
  52. data/lib/cyberarm_engine/ui/elements/button.rb +97 -97
  53. data/lib/cyberarm_engine/ui/elements/check_box.rb +54 -54
  54. data/lib/cyberarm_engine/ui/elements/container.rb +256 -256
  55. data/lib/cyberarm_engine/ui/elements/edit_box.rb +179 -179
  56. data/lib/cyberarm_engine/ui/elements/edit_line.rb +263 -263
  57. data/lib/cyberarm_engine/ui/elements/flow.rb +15 -15
  58. data/lib/cyberarm_engine/ui/elements/image.rb +72 -72
  59. data/lib/cyberarm_engine/ui/elements/list_box.rb +88 -82
  60. data/lib/cyberarm_engine/ui/elements/progress.rb +51 -51
  61. data/lib/cyberarm_engine/ui/elements/radio.rb +6 -6
  62. data/lib/cyberarm_engine/ui/elements/slider.rb +104 -104
  63. data/lib/cyberarm_engine/ui/elements/stack.rb +11 -11
  64. data/lib/cyberarm_engine/ui/elements/text_block.rb +162 -162
  65. data/lib/cyberarm_engine/ui/elements/toggle_button.rb +65 -65
  66. data/lib/cyberarm_engine/ui/event.rb +54 -54
  67. data/lib/cyberarm_engine/ui/gui_state.rb +256 -256
  68. data/lib/cyberarm_engine/ui/style.rb +49 -49
  69. data/lib/cyberarm_engine/ui/theme.rb +207 -207
  70. data/lib/cyberarm_engine/vector.rb +293 -293
  71. data/lib/cyberarm_engine/version.rb +4 -4
  72. data/lib/cyberarm_engine/window.rb +120 -120
  73. data/lib/cyberarm_engine.rb +71 -71
  74. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8a871fd51f7fb568600a1668f93f37b2fdc3a077d8e6b7310ff297ff60690df
4
- data.tar.gz: 80fb6e494d039fb78f03c656159d70f7388dd50673bf6171a27d7b63a973cdef
3
+ metadata.gz: 94a6e7a7e11272f44550677967ba2c1ad093a03191eec6cf0ce959e61b6c7250
4
+ data.tar.gz: 103f4161cad7eeb1296ba9c902fab13c85126fd7e9321567a2ae19b88103e5fd
5
5
  SHA512:
6
- metadata.gz: 9a4f3bddd2d3a146fc6a71496eb0bb8d00c10ce7fddaadd2ab81fa4972471ca47d029b43d141a4c39fca3b2d6c75018b1f97e7925d3a943c88891b0e1e79a30a
7
- data.tar.gz: 43bc7a87c50e0f56c9cecae84dbb1fc03c45ce3a2e30503b8074c42e0d981cabb1e1eb592a5e4e716d27aeb8ae5952421bd514332699f07a4bb8d894240a6e4b
6
+ metadata.gz: d6b975e8a81ae351ccb85daecbd4bd31f711929c3fbd00997c6fdcd1b45e1c7430e42a9c0f1ba5584969057044f53c396cdf44dbce8096ad1e3654cc5f63e130
7
+ data.tar.gz: 209ea1a470cd1369ea540586c3ea97598adf5ebdbc22ba7a09eb79fb1fdc4e1ab3f1a8866dc8759679798fc90ca0d702874907666633c5ecaa0dcac47dfece0b
data/.gitignore CHANGED
@@ -1,8 +1,8 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/.rubocop.yml CHANGED
@@ -1,8 +1,8 @@
1
- Style/StringLiterals:
2
- EnforcedStyle: double_quotes
3
-
4
- Metrics/MethodLength:
5
- Max: 40
6
-
7
- Style/EmptyMethod:
1
+ Style/StringLiterals:
2
+ EnforcedStyle: double_quotes
3
+
4
+ Metrics/MethodLength:
5
+ Max: 40
6
+
7
+ Style/EmptyMethod:
8
8
  EnforcedStyle: expanded
data/.travis.yml CHANGED
@@ -1,5 +1,5 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.5.0
5
- before_install: gem install bundler -v 1.16.1
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.5.0
5
+ before_install: gem install bundler -v 1.16.1
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in cyberarm_engine.gemspec
6
- gemspec
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in cyberarm_engine.gemspec
6
+ gemspec
data/LICENSE.txt CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2018 Cyberarm
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Cyberarm
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,74 +1,74 @@
1
- ![CyberarmEngine](https://raw.githubusercontent.com/cyberarm/cyberarm_engine/master/assets/textures/logo.png)
2
-
3
- Yet Another Game Engine On Top Of Gosu
4
-
5
- ## Features
6
- * [Shoes-like](http://shoesrb.com) GUI support
7
- * OpenGL Shader support (requires [opengl-bindings](https://github.com/vaiorabbit/ruby-opengl) gem)
8
- * Includes classes for handling Vectors, Rays, Bounding Boxes, and Transforms
9
- * GameState system
10
- * Monolithic GameObjects
11
-
12
- ## Installation
13
-
14
- Add this line to your application's Gemfile:
15
-
16
- ```ruby
17
- gem 'cyberarm_engine'
18
- ```
19
-
20
- And then execute:
21
-
22
- $ bundle
23
-
24
- Or install it yourself as:
25
-
26
- $ gem install cyberarm_engine
27
-
28
- ## Usage
29
-
30
- ```ruby
31
- require "cyberarm_engine"
32
-
33
- class Hello < CyberarmEngine::GuiState
34
- def setup
35
- background Gosu::Color::GRAY
36
-
37
- stack do
38
- label "Hello World!"
39
-
40
- button "close" do
41
- window.close
42
- end
43
- end
44
- end
45
- end
46
-
47
- class Window < CyberarmEngine::Window
48
- def setup
49
- self.show_cursor = true
50
-
51
- push_state(Hello)
52
- end
53
- end
54
-
55
- Window.new(width: 800, height: 600, fullscreen: false, resizable: true).show
56
- ```
57
-
58
- ## Development
59
-
60
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
61
-
62
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
63
-
64
- ## Contributing
65
-
66
- Bug reports and pull requests are welcome on GitHub at https://github.com/cyberarm/cyberarm_engine.
67
-
68
- ## License
69
-
70
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
71
-
72
- ## Code of Conduct
73
-
74
- Everyone interacting in the CyberarmEngine project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the ruby moto of "Matz is nice so we are nice."
1
+ ![CyberarmEngine](https://raw.githubusercontent.com/cyberarm/cyberarm_engine/master/assets/textures/logo.png)
2
+
3
+ Yet Another Game Engine On Top Of Gosu
4
+
5
+ ## Features
6
+ * [Shoes-like](http://shoesrb.com) GUI support
7
+ * OpenGL Shader support (requires [opengl-bindings](https://github.com/vaiorabbit/ruby-opengl) gem)
8
+ * Includes classes for handling Vectors, Rays, Bounding Boxes, and Transforms
9
+ * GameState system
10
+ * Monolithic GameObjects
11
+
12
+ ## Installation
13
+
14
+ Add this line to your application's Gemfile:
15
+
16
+ ```ruby
17
+ gem 'cyberarm_engine'
18
+ ```
19
+
20
+ And then execute:
21
+
22
+ $ bundle
23
+
24
+ Or install it yourself as:
25
+
26
+ $ gem install cyberarm_engine
27
+
28
+ ## Usage
29
+
30
+ ```ruby
31
+ require "cyberarm_engine"
32
+
33
+ class Hello < CyberarmEngine::GuiState
34
+ def setup
35
+ background Gosu::Color::GRAY
36
+
37
+ stack do
38
+ label "Hello World!"
39
+
40
+ button "close" do
41
+ window.close
42
+ end
43
+ end
44
+ end
45
+ end
46
+
47
+ class Window < CyberarmEngine::Window
48
+ def setup
49
+ self.show_cursor = true
50
+
51
+ push_state(Hello)
52
+ end
53
+ end
54
+
55
+ Window.new(width: 800, height: 600, fullscreen: false, resizable: true).show
56
+ ```
57
+
58
+ ## Development
59
+
60
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
61
+
62
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
63
+
64
+ ## Contributing
65
+
66
+ Bug reports and pull requests are welcome on GitHub at https://github.com/cyberarm/cyberarm_engine.
67
+
68
+ ## License
69
+
70
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
71
+
72
+ ## Code of Conduct
73
+
74
+ Everyone interacting in the CyberarmEngine project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the ruby moto of "Matz is nice so we are nice."
data/Rakefile CHANGED
@@ -1,10 +1,10 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
3
-
4
- Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- t.libs << "lib"
7
- t.test_files = FileList["test/**/*_test.rb"]
8
- end
9
-
10
- task default: :test
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task default: :test
data/bin/console CHANGED
@@ -1,14 +1,14 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "cyberarm_engine"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "cyberarm_engine"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup CHANGED
@@ -1,8 +1,8 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -1,39 +1,39 @@
1
- lib = File.expand_path("lib", __dir__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "cyberarm_engine/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "cyberarm_engine"
7
- spec.version = CyberarmEngine::VERSION
8
- spec.authors = ["Cyberarm"]
9
- spec.email = ["matthewlikesrobots@gmail.com"]
10
-
11
- spec.summary = "Make games quickly and easily with gosu"
12
- spec.description = "Yet another game making framework around gosu"
13
- spec.homepage = "https://github.com/cyberarm/cyberarm_engine"
14
- spec.license = "MIT"
15
-
16
- if spec.respond_to?(:metadata)
17
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
- else
19
- raise "RubyGems 2.0 or newer is required to protect against " \
20
- "public gem pushes."
21
- end
22
-
23
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
24
- f.match(%r{^(test|spec|features)/})
25
- end
26
- spec.bindir = "exe"
27
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
- spec.require_paths = %w[lib assets]
29
-
30
- spec.add_dependency "clipboard", "~> 1.3.5"
31
- spec.add_dependency "excon", "~> 0.78.0"
32
- spec.add_dependency "gosu", "~> 1.1"
33
- spec.add_dependency "gosu_more_drawables", "~> 0.3"
34
- # spec.add_dependency "ffi", :platforms => [:mswin, :mingw] # Required by Clipboard on Windows
35
-
36
- spec.add_development_dependency "bundler", "~> 2.2"
37
- spec.add_development_dependency "minitest", "~> 5.0"
38
- spec.add_development_dependency "rake", "~> 13.0"
39
- end
1
+ lib = File.expand_path("lib", __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "cyberarm_engine/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "cyberarm_engine"
7
+ spec.version = CyberarmEngine::VERSION
8
+ spec.authors = ["Cyberarm"]
9
+ spec.email = ["matthewlikesrobots@gmail.com"]
10
+
11
+ spec.summary = "Make games quickly and easily with gosu"
12
+ spec.description = "Yet another game making framework around gosu"
13
+ spec.homepage = "https://github.com/cyberarm/cyberarm_engine"
14
+ spec.license = "MIT"
15
+
16
+ if spec.respond_to?(:metadata)
17
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
+ else
19
+ raise "RubyGems 2.0 or newer is required to protect against " \
20
+ "public gem pushes."
21
+ end
22
+
23
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
24
+ f.match(%r{^(test|spec|features)/})
25
+ end
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.require_paths = %w[lib assets]
29
+
30
+ spec.add_dependency "clipboard", "~> 1.3.5"
31
+ spec.add_dependency "excon", "~> 0.78.0"
32
+ spec.add_dependency "gosu", "~> 1.1"
33
+ spec.add_dependency "gosu_more_drawables", "~> 0.3"
34
+ # spec.add_dependency "ffi", :platforms => [:mswin, :mingw] # Required by Clipboard on Windows
35
+
36
+ spec.add_development_dependency "bundler", "~> 2.2"
37
+ spec.add_development_dependency "minitest", "~> 5.0"
38
+ spec.add_development_dependency "rake", "~> 13.0"
39
+ end