Class: UI::Storage::PokemonIcon

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

Instance Attribute Summary

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 PokemonIconSprite

#update

Methods inherited from SpriteSheet

#bitmap=, #select

Methods inherited from Sprite

#load, #mouse_in?, #set_origin_div, #set_rect, #set_rect_div, #set_z, #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) ⇒ PokemonIcon

Returns a new instance of PokemonIcon.



4
5
6
7
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00201 PokemonIcon.rb', line 4

def initialize(viewport, index)
  super(viewport, false)
  @index = index
end

Instance Method Details

#data=(box)

Set the box data

Parameters:



11
12
13
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00201 PokemonIcon.rb', line 11

def data=(box)
  super(box.content[@index])
end

#simple_mouse_in?(mouse_x = Mouse.x, mouse_y = Mouse.y) ⇒ Boolean

Tell if the mouse is in the sprite

Returns:

  • (Boolean)


16
17
18
19
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00201 PokemonIcon.rb', line 16

def simple_mouse_in?(mouse_x = Mouse.x, mouse_y = Mouse.y)
  mx, my = translate_mouse_coords(mouse_x, mouse_y)
  return mx.between?(0, 31) && my.between?(0, 31)
end