Class: UI::PokemonFaceSprite
- Inherits:
-
Sprite
- Object
- LiteRGSS::Disposable
- LiteRGSS::Drawable
- LiteRGSS::Sprite
- LiteRGSS::ShaderedSprite
- Sprite
- UI::PokemonFaceSprite
- Defined in:
- scripts/01450 Systems/00000 General/00100 UI Generics/00500 HelperSprites.rb
Overview
Class that show the face sprite of a Pokemon
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from LiteRGSS::ShaderedSprite
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
-
#data=(pokemon)
Set the pokemon.
-
#initialize(viewport, auto_align = true) ⇒ PokemonFaceSprite
constructor
Create a new Pokemon FaceSprite.
-
#update
Update the face sprite.
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
Constructor Details
#initialize(viewport, auto_align = true) ⇒ PokemonFaceSprite
Create a new Pokemon FaceSprite
158 159 160 161 162 163 |
# File 'scripts/01450 Systems/00000 General/00100 UI Generics/00500 HelperSprites.rb', line 158 def initialize(, auto_align = true) super() @auto_align = auto_align # @type [Yuki::GifReader] @gif_reader = nil end |
Instance Method Details
#data=(pokemon)
Set the pokemon
167 168 169 170 171 172 |
# File 'scripts/01450 Systems/00000 General/00100 UI Generics/00500 HelperSprites.rb', line 167 def data=(pokemon) if (self.visible = (pokemon ? true : false)) bmp = self.bitmap = load_bitmap(pokemon) auto_align(bmp, pokemon) if @auto_align end end |
#update
Update the face sprite
175 176 177 |
# File 'scripts/01450 Systems/00000 General/00100 UI Generics/00500 HelperSprites.rb', line 175 def update @gif_reader&.update(bitmap) end |