gamebox 0.5.4 → 0.5.5
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/lib/gamebox/behaviors/graphical.rb +10 -9
- data/lib/gamebox/core/resource_manager.rb +2 -2
- data/lib/gamebox/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bc0be49028df4d4a95829f576283707724f0674
|
4
|
+
data.tar.gz: 84d355063593a23155b473a0a7cb9217515a8a1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a425bfc057c4ea8f29cf9c5ab8fa38b31eedbcb08e600c68f0bba971edb10a5b753b2bdf0b8231690affb4e83740846aeffb65c5fc1089f9aefdb54b6df4114
|
7
|
+
data.tar.gz: 50a526d23c43b03e7b839db373c7e72750aa099f31b73b37256106ce5ed4013a098450ad3016f1af10105e278cf1fae8b1c9c12520867db846f447749abf40f0
|
@@ -8,22 +8,23 @@ Behavior.define :graphical do
|
|
8
8
|
requires :resource_manager
|
9
9
|
setup do
|
10
10
|
image = actor.do_or_do_not(:image) || resource_manager.load_actor_image(actor)
|
11
|
-
|
12
|
-
|
11
|
+
tileable = opts[:tileable] || false
|
12
|
+
image = resource_manager.load_image(image, tileable) if image.is_a? String
|
13
|
+
scale = opts[:scale] || 1
|
13
14
|
|
14
15
|
actor.has_attribute :image
|
15
16
|
actor.image = image
|
16
17
|
|
17
18
|
actor.has_attributes( width: image.width,
|
18
19
|
height: image.height,
|
19
|
-
tiled:
|
20
|
-
view:
|
21
|
-
num_x_tiles:
|
22
|
-
num_y_tiles:
|
20
|
+
tiled: opts[:tiled],
|
21
|
+
view: opts[:view] || :graphical_actor_view,
|
22
|
+
num_x_tiles: opts[:num_x_tiles] || 1,
|
23
|
+
num_y_tiles: opts[:num_y_tiles] || 1,
|
23
24
|
scale: scale,
|
24
|
-
x_scale:
|
25
|
-
y_scale:
|
26
|
-
anchor:
|
25
|
+
x_scale: opts[:x_scale] || scale,
|
26
|
+
y_scale: opts[:y_scale] || scale,
|
27
|
+
anchor: opts[:anchor] || :center,
|
27
28
|
rotation: 0.0 )
|
28
29
|
|
29
30
|
actor.when :image_changed do |old, new|
|
@@ -75,7 +75,7 @@ class ResourceManager
|
|
75
75
|
action_imgs
|
76
76
|
end
|
77
77
|
|
78
|
-
def load_image(file_name)
|
78
|
+
def load_image(file_name, tileable=false)
|
79
79
|
cached_img = @loaded_images[file_name]
|
80
80
|
if cached_img.nil?
|
81
81
|
begin
|
@@ -84,7 +84,7 @@ class ResourceManager
|
|
84
84
|
#check global gamebox location
|
85
85
|
full_name = Gamebox.configuration.gb_gfx_path + file_name
|
86
86
|
end
|
87
|
-
cached_img = Image.new(@window, full_name)
|
87
|
+
cached_img = Image.new(@window, full_name, tileable)
|
88
88
|
rescue Exception => ex
|
89
89
|
# log "Cannot load image #{file_name}", :warn
|
90
90
|
end
|
data/lib/gamebox/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gamebox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shawn Anderson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-01-
|
13
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: gosu
|
@@ -563,4 +563,3 @@ test_files:
|
|
563
563
|
- spec/lib/class_finder_spec.rb
|
564
564
|
- spec/lib/rect_spec.rb
|
565
565
|
- spec/views/graphical_actor_view_spec.rb
|
566
|
-
has_rdoc:
|