gosu_texture_packer 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/gosu_texture_packer.gemspec +1 -0
- data/lib/gosu_texture_packer/tileset.rb +5 -6
- data/lib/gosu_texture_packer/version.rb +1 -1
- data/lib/gosu_texture_packer.rb +2 -2
- data/spec/gosu_texture_packer/tileset_spec.rb +5 -1
- data/spec/gosu_texture_packer_spec.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 554cd404394b1a635a8a07c2bf3f137df8c24b3a
|
4
|
+
data.tar.gz: 1848bcc35a5beb2fb45b920a7d7dc86a9bd7e78b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 457fc0eb442af931144056a048b40781c32da9ce5bbb4c0ebf613a9f19f8c416a53b88727bee304dad31c2f511895916ae647f2d23a0df0e2a5d6ea9ffed80e8
|
7
|
+
data.tar.gz: fbcfdca4cbcadc66606d0524a7994d73446f4e48fc1065b23801f25fddbe3ba8f5b5bc6b688b6943d57d83a2c7a4ef794a6405fc3f5809fcc91c290ad2dff150
|
data/README.md
CHANGED
@@ -37,8 +37,7 @@ tileset = Gosu::TexturePacker.load_json(gosu_window, '/path/to/tileset.json', :p
|
|
37
37
|
```
|
38
38
|
|
39
39
|
However, loading with `:precise` mode will significantly increase memory consumption and reduce
|
40
|
-
load time, so use it carefully.
|
41
|
-
precise mode.
|
40
|
+
load time, so use it carefully.
|
42
41
|
|
43
42
|
## Example Code
|
44
43
|
|
data/gosu_texture_packer.gemspec
CHANGED
@@ -3,13 +3,12 @@ module Gosu
|
|
3
3
|
module TexturePacker
|
4
4
|
class Tileset
|
5
5
|
|
6
|
-
def self.load_json(
|
7
|
-
self.new(
|
6
|
+
def self.load_json(json, mode = :fast)
|
7
|
+
self.new(json, mode)
|
8
8
|
end
|
9
9
|
|
10
|
-
def initialize(
|
10
|
+
def initialize(json, mode)
|
11
11
|
@mode = mode
|
12
|
-
@window = window
|
13
12
|
@json = JSON.parse(File.read(json))
|
14
13
|
@source_dir = File.dirname(json)
|
15
14
|
@main_image = build_main_image(mode)
|
@@ -40,7 +39,7 @@ module Gosu
|
|
40
39
|
def build_main_image(mode)
|
41
40
|
case mode
|
42
41
|
when :fast
|
43
|
-
Gosu::Image.new(
|
42
|
+
Gosu::Image.new(image_file, { :tileable => true })
|
44
43
|
when :precise
|
45
44
|
require 'RMagick' unless defined?(Magick)
|
46
45
|
Magick::ImageList.new(image_file).first
|
@@ -53,7 +52,7 @@ module Gosu
|
|
53
52
|
if @mode == :fast
|
54
53
|
@main_image.subimage(f['x'], f['y'], f['w'], f['h'])
|
55
54
|
else
|
56
|
-
Gosu::Image.new(@
|
55
|
+
Gosu::Image.new(@main_image, { :tileable => true, :rect => [f['x'], f['y'], f['w'], f['h']] } )
|
57
56
|
end
|
58
57
|
end
|
59
58
|
|
data/lib/gosu_texture_packer.rb
CHANGED
@@ -10,7 +10,7 @@ RSpec.describe Gosu::TexturePacker::Tileset do
|
|
10
10
|
let(:mode) { :fast }
|
11
11
|
|
12
12
|
subject(:instance) do
|
13
|
-
tileset_class.load_json(
|
13
|
+
tileset_class.load_json(tileset, mode)
|
14
14
|
end
|
15
15
|
|
16
16
|
shared_examples 'tileset' do
|
@@ -19,6 +19,10 @@ RSpec.describe Gosu::TexturePacker::Tileset do
|
|
19
19
|
it 'loads existing file' do
|
20
20
|
expect { subject }.to_not raise_error
|
21
21
|
end
|
22
|
+
|
23
|
+
it 'doesn\'t output Deprecation Warning' do
|
24
|
+
expect { subject }.to_not output.to_stdout
|
25
|
+
end
|
22
26
|
end
|
23
27
|
|
24
28
|
describe '#frame_list' do
|
@@ -8,7 +8,7 @@ RSpec.describe Gosu::TexturePacker do
|
|
8
8
|
|
9
9
|
describe '.load_json' do
|
10
10
|
it 'loads existing file' do
|
11
|
-
expect { Gosu::TexturePacker.load_json(
|
11
|
+
expect { Gosu::TexturePacker.load_json(tileset) }.to_not raise_error
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Varaneckas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gosu
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rmagick
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
141
|
version: '0'
|
128
142
|
requirements: []
|
129
143
|
rubyforge_project:
|
130
|
-
rubygems_version: 2.
|
144
|
+
rubygems_version: 2.6.13
|
131
145
|
signing_key:
|
132
146
|
specification_version: 4
|
133
147
|
summary: TexturePacker loader for Gosu game engine
|