Class: UI::ShortcutElement

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

Overview

UI component that shows a shortcut item

Constant Summary collapse

OFFSET_Y =

Offset Y to prevent UI element to overlap with BaseUI

28

Constants inherited from SpriteStack

UI::SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary collapse

Attributes inherited from SpriteStack

#animated, #data, #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, item_id, key) ⇒ ShortcutElement

Create a new Item sell button

Parameters:

  • viewport (Viewport)

    the viewport in which the SpriteStack will be displayed

  • index (Integer)

    index used to align the element in the UI

  • item_id (Integer, Symbol)

    ID of the item to show

  • key (Symbol)

    the key the player has to press



13
14
# File 'docs/01450_Systems_00207_Shortcut.rb', line 13

def initialize(viewport, index, item_id, key)
end

Instance Attribute Details

#indexInteger

Returns Index of the button in the list.

Returns:

  • (Integer)

    Index of the button in the list



7
8
9
# File 'docs/01450_Systems_00207_Shortcut.rb', line 7

def index
  @index
end