cyberarm_engine 0.6.0 → 0.7.0

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
  SHA256:
3
- metadata.gz: f11a60c76c06ce3939734baec31821815b26b779919cbcee7d0c289511a11c87
4
- data.tar.gz: 403a8b5e1ed211ee4240887f1851df14507c398b5052defa79c28b0a0c06cae7
3
+ metadata.gz: a4a3c6c90047eb40c2b9ca055ebe48a03e4d7198c753b498fa5475aade057560
4
+ data.tar.gz: 3feb7cf1e88075eef8cf2cebd5bc140d5dd0dfd446b3cde768c8b599594da1e1
5
5
  SHA512:
6
- metadata.gz: 4959236427d16fbf69636813f2cd013556b6633e80dce054f69273384af0ca73af944c109ebd51ace29e5329d56f8e2cda717b114cf63ba83dbedd28cae87e3d
7
- data.tar.gz: cabf8137a4add3a2eda6cda2cd737ffafde764bf208777deaa1d86dcb21ee8ec54204546ed841416217ed92c908aed4b02fd229927cfcb26d5fa0ee2a0896cb9
6
+ metadata.gz: c109e3788237c10b005f10288274e72073b8087a5d085e936aca3777049f534378232be4167daec1519edaf3c79428acdbdd91c7ff0d1b6ee6612c70df9bbc74
7
+ data.tar.gz: 00fd0b7150948cb35cffc0f413370fda115c5593a4dcd7664ece0fd816f7d7d40dbc68d368d3154671d8d2400c7c5fd8055f3309627878f69f5082c17bb2df1c
@@ -21,6 +21,14 @@ module CyberarmEngine
21
21
  recalculate
22
22
  end
23
23
 
24
+ def value
25
+ @toggle_button.value
26
+ end
27
+
28
+ def value=(bool)
29
+ @toggle_button.vlaue = bool
30
+ end
31
+
24
32
  def define_label_singletons
25
33
  @label.define_singleton_method(:_toggle_button) do |button|
26
34
  @_toggle_button = button
@@ -65,6 +65,11 @@ module CyberarmEngine
65
65
 
66
66
  def recalculate
67
67
  @current_position = Vector.new(@margin_left, @margin_top)
68
+ unless @visible
69
+ @width = 0
70
+ @height= 0
71
+ return
72
+ end
68
73
 
69
74
  layout
70
75
 
@@ -77,6 +77,12 @@ module CyberarmEngine
77
77
  def recalculate
78
78
  super
79
79
 
80
+ unless @visible
81
+ @width = 0
82
+ @height= 0
83
+ return
84
+ end
85
+
80
86
  @width = default(:width)
81
87
  update_background
82
88
  end
@@ -53,6 +53,7 @@ module CyberarmEngine
53
53
  # raise "#{self.class} 'padding' must be a number" unless @padding.is_a?(Numeric)
54
54
 
55
55
  @enabled = true
56
+ @visible = true
56
57
 
57
58
  default_events
58
59
  end
@@ -122,7 +123,28 @@ module CyberarmEngine
122
123
  @enabled
123
124
  end
124
125
 
126
+ def visible?
127
+ @visible
128
+ end
129
+
130
+ def toggle
131
+ @visible = !@visible
132
+ root.recalculate
133
+ end
134
+
135
+ def show
136
+ @visible = true
137
+ root.recalculate
138
+ end
139
+
140
+ def hide
141
+ @visible = false
142
+ root.recalculate
143
+ end
144
+
125
145
  def draw
146
+ return unless @visible
147
+
126
148
  @background_canvas.draw
127
149
  @border_canvas.draw
128
150
  render
@@ -31,6 +31,12 @@ module CyberarmEngine
31
31
  end
32
32
 
33
33
  def recalculate
34
+ unless @visible
35
+ @width = 0
36
+ @height= 0
37
+ return
38
+ end
39
+
34
40
  @width = @image.width * @scale_x
35
41
  @height = @image.height * @scale_y
36
42
  end
@@ -17,6 +17,12 @@ module CyberarmEngine
17
17
  end
18
18
 
19
19
  def recalculate
20
+ unless @visible
21
+ @width = 0
22
+ @height= 0
23
+ return
24
+ end
25
+
20
26
  @width = @text.width.round
21
27
  @height= @text.height.round
22
28
 
@@ -38,6 +38,12 @@ module CyberarmEngine
38
38
  def recalculate
39
39
  super
40
40
 
41
+ unless @visible
42
+ @width = 0
43
+ @height= 0
44
+ return
45
+ end
46
+
41
47
  @width = @text.textobject.text_width(@options[:checkmark])
42
48
  update_background
43
49
  end
@@ -1,4 +1,4 @@
1
1
  module CyberarmEngine
2
2
  NAME = "InDev"
3
- VERSION = "0.6.0"
3
+ VERSION = "0.7.0"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cyberarm_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyberarm
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-14 00:00:00.000000000 Z
11
+ date: 2019-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gosu