Class: MG::Slider

Inherits:
Widget show all
Defined in:
doc/API_reference.rb

Overview

slider.on_changed { puts slider.progress }

Instance Attribute Summary collapse

Attributes inherited from Node

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

Constructors collapse

Instance Method Summary collapse

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

#initializeSlider

Creates a new Slider widget.



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

def initialize; end

Instance Attribute Details

#progressInteger

Returns the progress direction of the slider, as a percentage value from 1 to 100.

Returns:

  • (Integer)

    the progress direction of the slider, as a percentage value from 1 to 100.



1582
1583
1584
# File 'doc/API_reference.rb', line 1582

def progress
  @progress
end

Instance Method Details

#load_bar_texture(value) ⇒ self

Load texture for slider bar.

Parameters:

  • value (String)

    a texture name.

Returns:

  • (self)

    the receiver.



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

def load_bar_texture(value); end

#load_progress_bar_texture(value) ⇒ self

Load texture for slider progress bar.

Parameters:

  • value (String)

    a texture name.

Returns:

  • (self)

    the receiver.



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

def load_progress_bar_texture(value); end

#load_slid_ball_textures(normal, pressed, disabled) ⇒ self

Load textures for slider ball.

Parameters:

  • normal (String)

    a ball normal normal state texture.

  • pressed (String)

    a ball selected selected state texture.

  • disabled (String)

    a ball disabled dark state texture.

Returns:

  • (self)

    the receiver.



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

def load_slid_ball_textures(normal, pressed, disabled); end

#on_changed { ... } ⇒ self

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

Yields:

  • the block will be called when a slider event is received.

Returns:

  • (self)

    the receiver.



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

def on_changed; end