Class: MG::Widget
Overview
The base class for all UI widgets. You should not instantiate this class directly but use a subclass instead.
Properties (collapse)
-
- (Boolean) enabled?
Whether the widget is enabled.
-
- (Boolean) highlighted?
Whether the widget is highlighted.
Attributes inherited from Node
#alpha, #anchor_point, #color, #name, #position, #rotation, #scale, #size, #visible?, #z_index
Events (collapse)
-
- (Widget) on_touch {|Symbol| ... }
Configures a block to be called when a touch event is received on the widget.
Methods inherited from Node
#add, #children, #clear, #delete, #delete_from_parent, #intersects?, #parent
Instance Attribute Details
- (Boolean) enabled?
Whether the widget is enabled. When enabled, a widget can be touched or clicked. By default, a widget is enabled.
726 727 728 |
# File 'motion-game', line 726
def enabled?
@enabled?
end
|
- (Boolean) highlighted?
Whether the widget is highlighted. By default, a widget is not highlighted.
730 731 732 |
# File 'motion-game', line 730
def highlighted?
@highlighted?
end
|
Instance Method Details
- (Widget) on_touch {|Symbol| ... }
Configures a block to be called when a touch event is received on the widget.
741 |
# File 'motion-game', line 741 def on_touch; end |