Gosuplus 1.0.23 → 1.0.24
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.
- data/lib/Gosuplus/entity.rb +1 -3
- data/lib/Gosuplus/gui/button.rb +7 -4
- data/lib/Gosuplus/state.rb +2 -0
- data/lib/Gosuplus/statemanager.rb +1 -0
- data/lib/Gosuplus/version.rb +1 -1
- metadata +1 -1
data/lib/Gosuplus/entity.rb
CHANGED
data/lib/Gosuplus/gui/button.rb
CHANGED
|
@@ -2,6 +2,7 @@ module Gosuplus
|
|
|
2
2
|
module GUI
|
|
3
3
|
class Button
|
|
4
4
|
attr_accessor :timer
|
|
5
|
+
|
|
5
6
|
def initialize(position, image, input_handler, key_id, text = nil, font = nil)
|
|
6
7
|
@icon = Icon.new(image, position)
|
|
7
8
|
@input_handler, @key_id = input_handler, key_id
|
|
@@ -9,10 +10,11 @@ module Gosuplus
|
|
|
9
10
|
@text = Text.new(text, font)
|
|
10
11
|
@text.center(@icon)
|
|
11
12
|
end
|
|
13
|
+
@visible = true
|
|
12
14
|
end
|
|
13
15
|
|
|
14
16
|
def draw
|
|
15
|
-
ButtonRenderer.draw(@icon, @text)
|
|
17
|
+
ButtonRenderer.draw(@icon, @text) if @visible
|
|
16
18
|
end
|
|
17
19
|
|
|
18
20
|
def update(x, y)
|
|
@@ -30,9 +32,10 @@ module Gosuplus
|
|
|
30
32
|
@timer.update
|
|
31
33
|
end
|
|
32
34
|
|
|
33
|
-
def active
|
|
34
|
-
|
|
35
|
-
end
|
|
35
|
+
def active?; @active; end
|
|
36
|
+
def visible?; @visible; end
|
|
37
|
+
def hide; @visible = false; end
|
|
38
|
+
def expose; @visible = true; end
|
|
36
39
|
|
|
37
40
|
private
|
|
38
41
|
def activated?(x, y)
|
data/lib/Gosuplus/state.rb
CHANGED
data/lib/Gosuplus/version.rb
CHANGED