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

#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



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

def initialize(viewport, pocket_indexes)
end

Instance Attribute Details

#index ⇒ Integer

Returns the current socket index.

Returns:

  • (Integer) —

    the current socket index



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

def index
  @index
end

Instance Method Details

#animate(target_index)

Start the animation between socket



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

def animate(target_index)
end

#done? ⇒ Boolean

Test if the animation is done

Returns:

  • (Boolean)


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

def done?
end

#mid? ⇒ Boolean

Test if the animation is at the middle of its progression

Returns:

  • (Boolean)


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

def mid?
end

#update

Update the animation



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

def update
end