Module: Savio
- Defined in:
- lib/savio.rb,
lib/savio/Scene.rb,
lib/savio/Button.rb,
lib/savio/Colors.rb,
lib/savio/Slider.rb,
lib/savio/hsv2rgb.rb,
lib/savio/version.rb,
lib/savio/InputBox.rb,
lib/savio/ColorSlider.rb,
lib/savio/IORenderable.rb,
lib/savio/ButtonManager.rb
Defined Under Namespace
Modules: Colors, IORenderable
Classes: Button, ButtonManager, ColorSlider, Error, HsvColor, InputBox, RgbColor, Scene, Slider
Constant Summary
collapse
- VERSION =
"0.1.8"
Class Method Summary
collapse
Class Method Details
.addElement(element) ⇒ Object
57
58
59
|
# File 'lib/savio.rb', line 57
def self.addElement(element)
@elements.push(element)
end
|
.elements ⇒ Object
53
54
55
|
# File 'lib/savio.rb', line 53
def self.elements
@elements
end
|
.guessType(value) ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/savio.rb', line 27
def self.guessType(value)
if value.to_i.to_s == value
return "int"
elsif value.to_f.to_s == value
return "float"
elsif value == "true" || value == "false"
return "bool"
else
return "str"
end
end
|
.hide ⇒ Object
66
67
68
69
70
|
# File 'lib/savio.rb', line 66
def self.hide
@elements.each do |e|
e.remove
end
end
|
.listen ⇒ Object
39
40
41
|
# File 'lib/savio.rb', line 39
def self.listen()
@listening = true
end
|
.listening ⇒ Object
47
48
49
|
# File 'lib/savio.rb', line 47
def self.listening
return @listening
end
|
.makeBool(value) ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'lib/savio.rb', line 18
def self.makeBool(value)
case value
when true, 'true', 1, '1', 't' then true
when false, 'false', nil, '', 0, '0', 'f' then false
else
return "no"
end
end
|
.removeElement(element) ⇒ Object
61
62
63
|
# File 'lib/savio.rb', line 61
def self.removeElement(element)
@elements.delete(element)
end
|
.stop ⇒ Object
43
44
45
|
# File 'lib/savio.rb', line 43
def self.stop()
@listening = false
end
|
.unhide ⇒ Object
72
73
74
75
76
|
# File 'lib/savio.rb', line 72
def self.unhide
@elements.each do |e|
e.add
end
end
|