smalruby 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
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: e79742c38c61cf25de31f1b89aba03ef25a971a5
|
4
|
+
data.tar.gz: 3c62f94a839dfaba9bf2f42c334ceac56516b583
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de0e92d51cb318d240eeac52dfe18819a0157e0ecbe5681d97f4bf5632df371c107683c6a81bb0e643e12e15b90547cdba134fe280e56f94ddf31e0a1f01db5c
|
7
|
+
data.tar.gz: d327022ed04602022b1b25e3089984e5927cdc1744efe2856e021e17750608da0b20422583dd2678630a22601dacdbe1b5d9fcea6a3197c5dd2b5d5348b7d8bb
|
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