Class: UI::DexWinSprite

Inherits:
SpriteStack show all
Defined in:
scripts/01450 Systems/00101 Dex/00002 UI/01400 Dex UIs.rb

Overview

Dex sprite that show the Pokemon sprite with its name

Constant Summary

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) ⇒ DexWinSprite

Create a new dex win sprite



5
6
7
8
9
10
11
12
13
14
15
16
# File 'scripts/01450 Systems/00101 Dex/00002 UI/01400 Dex UIs.rb', line 5

def initialize(viewport)
  # Create the sprite stack at coordinate 3, 11 using the RPG::Cache.pokedex as image source
  super(viewport, 3, 11, default_cache: :pokedex)

  # Show the background of the DexWinSprite
  add_background('WinSprite')
  # Show the Battler face of the Pokemon (Warning: PokemonFaceSprite use the bottom center as sprite origin)
  @sprite = add_sprite(60, 124, NO_INITIAL_IMAGE, type: PokemonFaceSprite)
  # Show the name of the Pokemon in bold upper-case
  pokemon_name = add_text(3, 6, 116, 19, :name_upper, 1, type: SymText, color: 10)
  pokemon_name.bold = true
end

Instance Method Details

#update_graphics

Update the graphics



19
20
21
# File 'scripts/01450 Systems/00101 Dex/00002 UI/01400 Dex UIs.rb', line 19

def update_graphics
  @sprite.update
end