Class: UI::Bag::ButtonList::ItemButton

Inherits:
SpriteStack show all
Defined in:
docs/4_Systems_103_Bag.rb

Overview

Button showing the item name

Constant Summary collapse

BACKGROUND =

Name of the button background

'bag/button_list'

Constants inherited from SpriteStack

SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary collapse

Attributes inherited from SpriteStack

#animated, #data, #font_id, #moving, #stack, #viewport, #x, #y

Instance Method Summary collapse

Methods inherited from SpriteStack

#[], #add_background, #add_line, #add_text, #anime, #anime_delta_set, #dispose, #each, #execute_anime, #move, #move_to, #opacity, #opacity=, #push, #push_sprite, #set_origin, #set_position, #simple_mouse_in?, #size, #stop_animation, #translate_mouse_coords, #update, #update_animation, #update_position, #visible, #visible=, #with_cache, #with_font, #with_surface, #z, #z=

Constructor Details

#initialize(viewport, index) ⇒ ItemButton

Create a new Item button

Parameters:



347
348
# File 'docs/4_Systems_103_Bag.rb', line 347

def initialize(viewport, index)
end

Instance Attribute Details

#index ⇒ Integer

Returns Index of the button in the list.

Returns:

  • (Integer) —

    Index of the button in the list



343
344
345
# File 'docs/4_Systems_103_Bag.rb', line 343

def index
  @index
end

Instance Method Details

#active? ⇒ Boolean

Is the button active

Returns:

  • (Boolean)


350
351
# File 'docs/4_Systems_103_Bag.rb', line 350

def active?
end

#reset

Reset the button coordinate



357
358
# File 'docs/4_Systems_103_Bag.rb', line 357

def reset
end

#text=(text)

Set the button text

Parameters:

  • text (String, nil) —

    the item name



354
355
# File 'docs/4_Systems_103_Bag.rb', line 354

def text=(text)
end