smalruby 0.0.11-x86-mingw32 → 0.0.12-x86-mingw32
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.
Potentially problematic release.
This version of smalruby might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/smalruby/character.rb +8 -5
- data/lib/smalruby/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 893936bc5774fe45d4eaad40b553947745e83497
|
4
|
+
data.tar.gz: cec60036e1569da08d723ee4bb1e72100f7028b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efa9ed19fac900c24a682354daf39e2ed947bce61cc6221b9f9d07a975105cdc35d55610793c3fb681bc7a082d3ffdc11879da47508fab239fcf7e0e999f56a9
|
7
|
+
data.tar.gz: b56dc272f8fd0792117cff9acfab679c63b61e8c59c6e0958d1f0b34be9d761f0a36424a913b286083dff69aa0d265d879334889df4a4bd0b15e6658b4187dc9
|
data/lib/smalruby/character.rb
CHANGED
@@ -125,9 +125,10 @@ module Smalruby
|
|
125
125
|
@balloon = nil
|
126
126
|
end
|
127
127
|
|
128
|
-
|
128
|
+
message = opts[:message].to_s
|
129
|
+
return if message.empty?
|
129
130
|
|
130
|
-
lines =
|
131
|
+
lines = message.to_s.lines.map { |l| l.scan(/.{1,10}/) }.flatten
|
131
132
|
font = new_font(16)
|
132
133
|
width = lines.map { |l| font.get_width(l) }.max
|
133
134
|
height = lines.length * (font.size + 1)
|
@@ -145,9 +146,11 @@ module Smalruby
|
|
145
146
|
width + (frame_size + margin_size) + margin_size - 1,
|
146
147
|
height + (frame_size + margin_size) + margin_size - 1,
|
147
148
|
[255, 255, 255])
|
148
|
-
|
149
|
-
|
150
|
-
|
149
|
+
lines.each.with_index do |line, row|
|
150
|
+
image.draw_font(frame_size + margin_size,
|
151
|
+
frame_size + margin_size + (font.size + 1) * row,
|
152
|
+
line, font, [0, 0, 0])
|
153
|
+
end
|
151
154
|
@balloon = Sprite.new(self.x, self.y, image)
|
152
155
|
end
|
153
156
|
|
data/lib/smalruby/version.rb
CHANGED