Class: UI::Shop::ItemList::ListButton

Inherits:
UI::SpriteStack show all
Defined in:
docs/01450_Systems_00203_Shop.rb

Overview

Button for an item in the list

Constant Summary

Constants inherited from UI::SpriteStack

UI::SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary collapse

Attributes inherited from UI::SpriteStack

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

Instance Method Summary collapse

Methods inherited from UI::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) ⇒ ListButton

Create a new Item sell button

Parameters:

  • viewport (Viewport)

    the viewport in which the SpriteStack will be displayed

  • index (Integer)


206
207
# File 'docs/01450_Systems_00203_Shop.rb', line 206

def initialize(viewport, index)
end

Instance Attribute Details

#indexInteger

Returns Index of the button in the list.

Returns:

  • (Integer)

    Index of the button in the list



202
203
204
# File 'docs/01450_Systems_00203_Shop.rb', line 202

def index
  @index
end

Instance Method Details

#active?Boolean

Is the button active

Returns:

  • (Boolean)


209
210
# File 'docs/01450_Systems_00203_Shop.rb', line 209

def active?
end

#icon_data=(icon)

Set the item icon

Parameters:

  • icon (Integer)

    the item id for the icon



221
222
# File 'docs/01450_Systems_00203_Shop.rb', line 221

def icon_data=(icon)
end

#price=(price)

Set the item price

Parameters:

  • price (Integer, nil)

    the item price



217
218
# File 'docs/01450_Systems_00203_Shop.rb', line 217

def price=(price)
end

#reset

Reset the button coordinate



224
225
# File 'docs/01450_Systems_00203_Shop.rb', line 224

def reset
end

#text=(text)

Set the button text

Parameters:

  • text (String, nil)

    the item name



213
214
# File 'docs/01450_Systems_00203_Shop.rb', line 213

def text=(text)
end