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.
680 681 682 |
# File 'motion-game', line 680
def enabled?
@enabled?
end
|
- (Boolean) highlighted?
Whether the widget is highlighted. By default, a widget is not highlighted.
684 685 686 |
# File 'motion-game', line 684
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.
695 |
# File 'motion-game', line 695 def on_touch; end |