minigl 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -1
- data/lib/minigl/forms.rb +10 -9
- data/lib/minigl/global.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d947f9f6b2942d8c013e40a3bcb133c05e568b5
|
4
|
+
data.tar.gz: 73a2e40462939be5c50da793498365fee9b6317a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efbef16eee12d57c33ce6083ac0ec633658c46a9f0a32a1ecde2ec76f386f924d69f0a412fd70087d627bb05f692b3c44da3cc1a597a9ed45fd93e9089b01dd6
|
7
|
+
data.tar.gz: 9c794f33476e267e804fac724c396da080918b8fb7fb6ea0fc047fabda804afa3ff4509a5937676acee0c6a540b1193b072f33dfd1081989ab5d0ea59ea3ad98
|
data/README.md
CHANGED
@@ -19,5 +19,10 @@ Please note:
|
|
19
19
|
provided by the gem is difficult to test automatically, but you can check out
|
20
20
|
this [working game example](https://github.com/victords/aventura-do-saber).
|
21
21
|
* The [documentation](https://github.com/victords/minigl/wiki) is under
|
22
|
-
construction.
|
22
|
+
construction.
|
23
23
|
|
24
|
+
**Version 1.2.2**
|
25
|
+
|
26
|
+
* Adjust in `Res.font` to distinguish fonts loaded with different sizes.
|
27
|
+
* Adjust in `TextField` to draw cursor image in the correct position and
|
28
|
+
z-index.
|
data/lib/minigl/forms.rb
CHANGED
@@ -343,8 +343,17 @@ module AGL
|
|
343
343
|
|
344
344
|
def draw
|
345
345
|
@img.draw @x, @y, 0
|
346
|
+
@font.draw @text, @text_x, @text_y, 0, 1, 1, 0xff000000
|
347
|
+
|
348
|
+
if @anchor1 and @anchor2
|
349
|
+
Game.window.draw_quad @nodes[@anchor1], @text_y, 0x80000000,
|
350
|
+
@nodes[@anchor2] + 1, @text_y, 0x80000000,
|
351
|
+
@nodes[@anchor2] + 1, @text_y + @font.height, 0x80000000,
|
352
|
+
@nodes[@anchor1], @text_y + @font.height, 0x80000000, 0
|
353
|
+
end
|
354
|
+
|
346
355
|
if @cursor_visible
|
347
|
-
if @cursor_img; @cursor_img.draw @
|
356
|
+
if @cursor_img; @cursor_img.draw @nodes[@cur_node] - @cursor_img.width / 2, @text_y, 0
|
348
357
|
else
|
349
358
|
Game.window.draw_quad @nodes[@cur_node], @text_y, 0xff000000,
|
350
359
|
@nodes[@cur_node] + 1, @text_y, 0xff000000,
|
@@ -352,14 +361,6 @@ module AGL
|
|
352
361
|
@nodes[@cur_node], @text_y + @font.height, 0xff000000, 0
|
353
362
|
end
|
354
363
|
end
|
355
|
-
@font.draw @text, @text_x, @text_y, 0, 1, 1, 0xff000000
|
356
|
-
|
357
|
-
if @anchor1 and @anchor2
|
358
|
-
Game.window.draw_quad @nodes[@anchor1], @text_y, 0x80000000,
|
359
|
-
@nodes[@anchor2] + 1, @text_y, 0x80000000,
|
360
|
-
@nodes[@anchor2] + 1, @text_y + @font.height, 0x80000000,
|
361
|
-
@nodes[@anchor1], @text_y + @font.height, 0x80000000, 0
|
362
|
-
end
|
363
364
|
end
|
364
365
|
end
|
365
366
|
end
|
data/lib/minigl/global.rb
CHANGED
@@ -222,10 +222,11 @@ module AGL
|
|
222
222
|
|
223
223
|
def self.font id, size, global = true, ext = ".ttf"
|
224
224
|
if global; a = @@global_fonts; else; a = @@fonts; end
|
225
|
-
|
225
|
+
id_size = "#{id}_#{size}"
|
226
|
+
return a[id_size] if a[id_size]
|
226
227
|
s = "data/font/" + id.to_s.split('_').join('/') + ext
|
227
228
|
font = Gosu::Font.new Game.window, s, size
|
228
|
-
a[
|
229
|
+
a[id_size] = font
|
229
230
|
end
|
230
231
|
|
231
232
|
# def self.text id
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minigl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor David Santos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gosu
|