Class: UI::Bag::BagSprite

Overview

Class that show the bag sprite in the Bag UI

Constant Summary collapse

POCKET_TRANSLATION =

Array translating real pocket id to sprite piece

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

Coordinates of the bag

[71, 103]

Instance Attribute Summary collapse

Attributes inherited from SpriteSheet

#nb_x, #nb_y, #sx, #sy

Attributes inherited from LiteRGSS::ShaderedSprite

#blendmode, #shader

Attributes inherited from LiteRGSS::Sprite

#__index__, #angle, #bitmap, #height, #mirror, #opacity, #ox, #oy, #src_rect, #viewport, #visible, #width, #x, #y, #z, #zoom, #zoom_x, #zoom_y

Instance Method Summary collapse

Methods inherited from SpriteSheet

#bitmap=, #resize, #select

Methods inherited from Sprite

#load, #mouse_in?, #set_origin_div, #set_rect, #set_rect_div, #set_z, #simple_mouse_in?, #translate_mouse_coords

Methods inherited from LiteRGSS::Sprite

new, #set_origin, #set_position

Methods inherited from LiteRGSS::Disposable

#dispose, #disposed?

Constructor Details

#initialize(viewport, pocket_indexes) ⇒ BagSprite

Create a new Bah Sprite

Parameters:

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

    each shown pocket by the UI



249
250
# File 'docs/4_Systems_103_Bag.rb', line 249

def initialize(viewport, pocket_indexes)
end

Instance Attribute Details

#indexInteger

Returns the current socket index.

Returns:

  • (Integer)

    the current socket index



241
242
243
# File 'docs/4_Systems_103_Bag.rb', line 241

def index
  @index
end

Instance Method Details

#animate(target_index)

Start the animation between socket



255
256
# File 'docs/4_Systems_103_Bag.rb', line 255

def animate(target_index)
end

#done?Boolean

Test if the animation is done

Returns:

  • (Boolean)


262
263
# File 'docs/4_Systems_103_Bag.rb', line 262

def done?
end

#mid?Boolean

Test if the animation is at the middle of its progression

Returns:

  • (Boolean)


266
267
# File 'docs/4_Systems_103_Bag.rb', line 266

def mid?
end

#update

Update the animation



258
259
# File 'docs/4_Systems_103_Bag.rb', line 258

def update
end