Class: MG::Button
Overview
button.on_touch { |type| puts “touched!” if type == :end }
Instance Attribute Summary collapse
-
#font ⇒ String
Name of the font used for the button title.
-
#font_size ⇒ Integer
Size of the font used by for button title.
-
#text ⇒ String
Title of the button.
-
#text_color ⇒ Color
Color of the title.
-
#zoom_scale ⇒ Float
The value with which the button will zoom when the user presses it.
Attributes inherited from Node
#alpha, #anchor_point, #color, #name, #position, #rotation, #scale, #size, #z_index
Constructors collapse
-
#initialize(title = '', font = '', font_size = 0) ⇒ Button
constructor
Creates a new Button widget with an optional title.
Instance Method Summary collapse
-
#load_texture_disabled(name) ⇒ self
Load disabled state texture for button.
-
#load_texture_normal(name) ⇒ self
Load normal state texture for button.
-
#load_texture_pressed(name) ⇒ self
Load selected state texture for button.
Methods inherited from Widget
#enabled=, #enabled?, #highlighted=, #highlighted?, #on_touch, #touch_enabled=, #touch_enabled?
Methods inherited from Node
#add, #children, #clear, #delete, #delete_from_parent, #intersects?, #number_of_running_actions, #parent, #run_action, #schedule, #schedule_once, #stop_action, #stop_all_actions, #unschedule, #visible=, #visible?
Constructor Details
#initialize(title = '', font = '', font_size = 0) ⇒ Button
Creates a new Button widget with an optional title.
1433 |
# File 'doc/API_reference.rb', line 1433 def initialize(title='', font='', font_size=0); end |
Instance Attribute Details
#font ⇒ String
Returns name of the font used for the button title.
1445 1446 1447 |
# File 'doc/API_reference.rb', line 1445 def font @font end |
#font_size ⇒ Integer
Returns size of the font used by for button title.
1448 1449 1450 |
# File 'doc/API_reference.rb', line 1448 def font_size @font_size end |
#text ⇒ String
Returns title of the button.
1439 1440 1441 |
# File 'doc/API_reference.rb', line 1439 def text @text end |
#text_color ⇒ Color
Returns color of the title.
1442 1443 1444 |
# File 'doc/API_reference.rb', line 1442 def text_color @text_color end |
#zoom_scale ⇒ Float
Returns the value with which the button will zoom when the user presses it.
1452 1453 1454 |
# File 'doc/API_reference.rb', line 1452 def zoom_scale @zoom_scale end |
Instance Method Details
#load_texture_disabled(name) ⇒ self
Load disabled state texture for button.
1467 |
# File 'doc/API_reference.rb', line 1467 def load_texture_disabled(name); end |
#load_texture_normal(name) ⇒ self
Load normal state texture for button.
1457 |
# File 'doc/API_reference.rb', line 1457 def load_texture_normal(name); end |
#load_texture_pressed(name) ⇒ self
Load selected state texture for button.
1462 |
# File 'doc/API_reference.rb', line 1462 def load_texture_pressed(name); end |