Class: UI::Storage::PokemonItemIcon

Inherits:
ItemSprite show all
Defined in:
scripts/01450 Systems/00200 Storage/00002 UI_Storage/00201 PokemonIcon.rb

Instance Attribute Summary

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 Sprite

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

Methods inherited from LiteRGSS::Sprite

new, #set_origin, #set_position

Methods inherited from LiteRGSS::Disposable

#dispose, #disposed?

Constructor Details

#initialize(viewport, index) ⇒ PokemonItemIcon

Returns a new instance of PokemonItemIcon.



23
24
25
26
27
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00201 PokemonIcon.rb', line 23

def initialize(viewport, index)
  super(viewport)
  @index = index
  self.opacity = 0
end

Instance Method Details

#data=(box)

Set the box data

Parameters:



31
32
33
34
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00201 PokemonIcon.rb', line 31

def data=(box)
  item_id = box.content[@index]&.item_db_symbol
  super(item_id) if (self.visible = (item_id && item_id != :__undef__))
end