Class: MG::Widget

Inherits:
Node
  • Object
show all
Defined in:
doc/API_reference.rb

Overview

directly but use a subclass instead.

Instance Attribute Summary

Attributes inherited from Node

#alpha, #anchor_point, #color, #name, #position, #rotation, #scale, #size, #z_index

Events collapse

Instance Method Summary collapse

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?

Instance Method Details

#enabled=(value) ⇒ Object

Set whether the widget is enabled.

Parameters:

  • value (Boolean)

    true if the widget is enabled, widget may be touched , false if the widget is disabled, widget cannot be touched. The default value is true, a widget is default to enabled



1303
# File 'doc/API_reference.rb', line 1303

def enabled=(value); end

#enabled?Boolean

Whether the widget is enabled. When enabled, a widget can be touched or clicked. By default, a widget is enabled.

Returns:

  • (Boolean)

    whether the widget is enabled.



1296
# File 'doc/API_reference.rb', line 1296

def enabled?; end

#highlighted=(value) ⇒ Object

Set whether the widget is hilighted.

Parameters:

  • value (Boolean)

    true if the widget is hilighted, false if the widget is not hilighted.



1322
# File 'doc/API_reference.rb', line 1322

def highlighted=(value); end

#highlighted?Boolean

Whether the widget is highlighted. By default, a widget is not highlighted.

Returns:

  • (Boolean)

    whether the widget is highlighted.



1317
# File 'doc/API_reference.rb', line 1317

def highlighted?; end

#on_touch {|Symbol| ... } ⇒ self

Configures a block to be called when a touch event is received on the widget.

Yields:

  • (Symbol)

    the given block will be called when the event is received with a Symbol that describes the type of event, which can be :begin, :move, :end or :cancel.

Returns:

  • (self)

    the receiver.



1333
# File 'doc/API_reference.rb', line 1333

def on_touch; end

#touch_enabled=(value) ⇒ Object

Set whether the widget is touch enabled.

Parameters:

  • value (Boolean)

    true if the widget is touch enabled, false if the widget is touch disabled.



1313
# File 'doc/API_reference.rb', line 1313

def touch_enabled=(value); end

#touch_enabled?Boolean

Whether the widget is touch enabled. When touch enabled, a widget supports on_touch. By default, a widget is not touch enabled.

Returns:

  • (Boolean)

    whether the widget is touch enabled.



1308
# File 'doc/API_reference.rb', line 1308

def touch_enabled?; end