Class: UI::Bag::PocketList

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

Overview

Utility showing the pocket list

Constant Summary collapse

ACTIVE_BASE_COORDINATES =

Base coordinate of the active items

[0, 192]
INACTIVE_BASE_COORDINATES =

Base coordinate of the inactive items

[0, 198]
OFFSET_X =

Offset between each sprites

20
POCKET_TRANSLATION =

Array translating real pocket id to sprite piece

[0, 0, 1, 3, 5, 4, 2, 6, 7]
ACTIVE_IMAGE =

Name of the active image

'bag/pockets_active'
INACTIVE_IMAGE =

Name of the inactive image

'bag/pockets_inactive'

Constants inherited from SpriteStack

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, pocket_indexes) ⇒ PocketList

Create a new pocket list

Parameters:

  • viewport (Viewport)
  • pocket_indexes (Array<Integer>)

    each shown pocket by the UI



158
159
# File 'docs/4_Systems_103_Bag.rb', line 158

def initialize(viewport, pocket_indexes)
end

Instance Attribute Details

#indexInteger

Returns index of the current selected pocket.

Returns:

  • (Integer)

    index of the current selected pocket



142
143
144
# File 'docs/4_Systems_103_Bag.rb', line 142

def index
  @index
end