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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee71302e4c1c310af7e3c6357b99d7678c26c7a2
4
- data.tar.gz: 828af95552ce471ca273253326553c483421ea23
3
+ metadata.gz: 7d947f9f6b2942d8c013e40a3bcb133c05e568b5
4
+ data.tar.gz: 73a2e40462939be5c50da793498365fee9b6317a
5
5
  SHA512:
6
- metadata.gz: 679b54d84b1c9df920e8fa425532554c1ee4d9abc651c38bf222e74dcb9469548aad710656be78e5d7807bfad6d576cb60fba73c03887f426ffaf6ba6d8c310b
7
- data.tar.gz: d36f9fee78e3fcd54a47d422f5bfa82fee2479e6ec47f7d2ffe560703ba09e063645017f0c490a2f4363472d70f59f3029dc5a6e79f935e3957c8e50c1095702
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 @text_x, @text_y, 0
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
- return a[id] if a[id]
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[id] = font
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.1
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-15 00:00:00.000000000 Z
11
+ date: 2014-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gosu