Class: UI::MoveTeaching::PokemonInfos

Inherits:
SpriteStack show all
Defined in:
scripts/01450 Systems/00301 MoveTeaching/00002 UI/00020 PokemonInfos.rb

Overview

UI part displaying the Pokémon informations in the Skill Learn scene

Constant Summary collapse

NO_GENDER =

List of Pokemon that shouldn't show the gender sprite

%i[nidoranf nidoranm]

Constants inherited from SpriteStack

SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary

Attributes inherited from SpriteStack

#animated, #data, #moving, #stack, #viewport, #x, #y

Instance Method Summary collapse

Methods inherited from SpriteStack

#[], #add_background, #add_line, #add_text, #anime, #anime_delta_set, #dispose, #each, #execute_anime, #move, #move_to, #opacity, #opacity=, #push, #push_sprite, #set_origin, #set_position, #simple_mouse_in?, #size, #stop_animation, #translate_mouse_coords, #update, #update_animation, #update_position, #visible, #visible=, #with_cache, #with_font, #with_surface, #z, #z=

Constructor Details

#initialize(viewport) ⇒ PokemonInfos

Create sprite & some informations of the Pokémon

Parameters:



9
10
11
12
# File 'scripts/01450 Systems/00301 MoveTeaching/00002 UI/00020 PokemonInfos.rb', line 9

def initialize(viewport)
  super(viewport, 8, 15, default_cache: :interface)
  create_sprites
end

Instance Method Details

#data=(pokemon)

Set the data of the Pokemon



15
16
17
18
19
# File 'scripts/01450 Systems/00301 MoveTeaching/00002 UI/00020 PokemonInfos.rb', line 15

def data=(pokemon)
  super
  @gender.x = @name.x + @name.real_width + 2
  @gender.visible = false if NO_GENDER.include?(pokemon.db_symbol)
end

#update_graphics

Update the graphics



22
23
24
# File 'scripts/01450 Systems/00301 MoveTeaching/00002 UI/00020 PokemonInfos.rb', line 22

def update_graphics
  @sprite.update
end