gosu_texture_packer 0.1.0 → 0.1.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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/examples/tile_brush.rb +1 -1
- data/lib/gosu_texture_packer.rb +3 -1
- data/lib/gosu_texture_packer/version.rb +1 -1
- data/spec/gosu_texture_packer/tileset_spec.rb +1 -1
- data/spec/gosu_texture_packer_spec.rb +14 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f8723b6eae8b871d5f20363d5bbb33538f1efed
|
4
|
+
data.tar.gz: 544a731c41733e3388d4ebfe978fcd22fe1207d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e2c157d0df066b8d08829da3155f64ea8834158eb569eabf74b93628515cc29d2351c39f5d09846867beac072f68d7770d19f824f949ba32e610549ee730018
|
7
|
+
data.tar.gz: 2057f5e616b1a12b1192c1e854734ca591f5cbf77981fa25513fd5e16016dd07a6fd8e773482de31511b6ddfe35d2ce5ae39c79d416d27c500a52e1817a02e52
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ Or install it yourself as:
|
|
22
22
|
## Usage
|
23
23
|
|
24
24
|
```ruby
|
25
|
-
tileset = Gosu::TexturePacker
|
25
|
+
tileset = Gosu::TexturePacker.load_json(gosu_window, '/path/to/tileset.json')
|
26
26
|
frame_names = tileset.frame_list
|
27
27
|
tile = tileset.frame(frame_names.first)
|
28
28
|
tile.draw(0, 0, 0) # tile is Gosu::Image
|
data/examples/tile_brush.rb
CHANGED
@@ -10,7 +10,7 @@ class GameWindow < Gosu::Window
|
|
10
10
|
def initialize
|
11
11
|
super(640, 480, false)
|
12
12
|
self.caption = 'Click screen with mouse to draw textures'
|
13
|
-
@tileset = Gosu::TexturePacker
|
13
|
+
@tileset = Gosu::TexturePacker.load_json(
|
14
14
|
self, File.join(ROOT_DIR, 'spec', 'files', '_UI.json'))
|
15
15
|
@drawing = {}
|
16
16
|
end
|
data/lib/gosu_texture_packer.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Gosu::TexturePacker do
|
4
|
+
|
5
|
+
let(:media_dir) { File.join(File.dirname(__FILE__), 'files') }
|
6
|
+
let(:tileset) { File.join(media_dir, '_UI.json') }
|
7
|
+
let(:game_window) { Gosu::Window.new(640, 480, false) }
|
8
|
+
|
9
|
+
describe '.load_json' do
|
10
|
+
it 'loads existing file' do
|
11
|
+
expect { Gosu::TexturePacker.load_json(game_window, tileset) }.to_not raise_error
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gosu_texture_packer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Varaneckas
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- spec/files/_UI.json
|
119
119
|
- spec/files/_UI.png
|
120
120
|
- spec/gosu_texture_packer/tileset_spec.rb
|
121
|
+
- spec/gosu_texture_packer_spec.rb
|
121
122
|
- spec/spec_helper.rb
|
122
123
|
homepage: https://github.com/spajus/gosu-texture-packer
|
123
124
|
licenses:
|
@@ -148,4 +149,5 @@ test_files:
|
|
148
149
|
- spec/files/_UI.json
|
149
150
|
- spec/files/_UI.png
|
150
151
|
- spec/gosu_texture_packer/tileset_spec.rb
|
152
|
+
- spec/gosu_texture_packer_spec.rb
|
151
153
|
- spec/spec_helper.rb
|