minigl 2.2.4 → 2.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5575ec51f8c440578ef76b9056ca136c4005996f7805c92786e28d40ea7c9e4b
4
- data.tar.gz: 5c162f0097923b8cfac025a2a933f6f6432e7c6cd4a8e7b3a5cefd8f5b55c992
3
+ metadata.gz: 17cfec4fd44f2a4796d2be16f7de9d19ab5be6d9d3dce59fb5e0154c9fb153ae
4
+ data.tar.gz: 542db7203b4c9cec72be26037058ab9fec3487078da77c4099056ea0a96dace2
5
5
  SHA512:
6
- metadata.gz: 41075c7445649d528d30fd6cf9801be78f8831bec10f2cf2515c9786a681959125f751e2d7d8d6550700ab86f3074a1df27a5ed7e47271dc5972304ea8e6800d
7
- data.tar.gz: 2c4557739d0910a795bb41229c3d58e76116b8e46d5b8ba9a34d73d556eea51faef61931a10fe23e4f9ba0b72da79ccd938df4046ad5d66c6ae071530212c42f
6
+ metadata.gz: 87bd0c8b076fa41be74210c657dd7eeaf90ce1d7768a211018de80d7c807b6b5a776b76c317998e660d60c09550b772f2dd6783f53556fd50c746c3c27f67fcf
7
+ data.tar.gz: e47d4b80ec4979ca6e8b63c6b818d247a3ff9af939447d4b4bf68d2d01c0fb934211311ee2c1abb41014981703ef0d8cf72fc7bcaa313cadc9432b81fbd6fe93
data/README.md CHANGED
@@ -29,7 +29,6 @@ After installing the Gosu dependencies, you can just `gem install minigl`.
29
29
  * The [wiki](https://github.com/victords/minigl/wiki) is a work in progress with tutorials and examples.
30
30
  * Test package and examples aren't complete!
31
31
 
32
- ## Version 2.2.4
32
+ ## Version 2.2.5
33
33
 
34
- * Fixed components being updated in invisible `Panel`s.
35
- * Clarified the documentation of the `Map` class.
34
+ * Fixed `Sprite#animate_once` and added the possibility of passing a callback.
@@ -82,10 +82,7 @@ module MiniGL
82
82
  # [interval] The amount of frames between each change in the image index.
83
83
  # See +animate+ for details.
84
84
  def animate_once(indices, interval)
85
- if @animate_once_control == 2
86
- return if indices == @animate_once_indices && interval == @animate_once_interval
87
- @animate_once_control = 0
88
- end
85
+ return if @animate_once_control == 2
89
86
 
90
87
  unless @animate_once_control == 1
91
88
  @anim_counter = 0
@@ -100,10 +97,14 @@ module MiniGL
100
97
  @anim_counter += 1
101
98
  return unless @anim_counter >= interval
102
99
 
103
- @index_index += 1
104
- @img_index = indices[@index_index]
105
- @anim_counter = 0
106
- @animate_once_control = 2 if @index_index == indices.length - 1
100
+ if @index_index == indices.length - 1
101
+ @animate_once_control = 2
102
+ yield if block_given?
103
+ else
104
+ @index_index += 1
105
+ @img_index = indices[@index_index]
106
+ @anim_counter = 0
107
+ end
107
108
  end
108
109
 
109
110
  # Resets the animation timer and immediately changes the image index to
@@ -116,6 +116,11 @@ class MyGame < GameWindow
116
116
  @objs.each_with_index do |o, i|
117
117
  o.move_free(i * 45, 3)
118
118
  end
119
+
120
+ @obj3.animate_once([1, 2, 3, 4], 15) do
121
+ puts 'acabou'
122
+ end
123
+ @obj3.set_animation 0 if KB.key_pressed? Gosu::KB_0
119
124
  end
120
125
 
121
126
  def draw
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: 2.2.4
4
+ version: 2.2.5
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: 2019-02-22 00:00:00.000000000 Z
11
+ date: 2019-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gosu