Class: UI::Summary_Top

Inherits:
SpriteStack show all
Defined in:
scripts/01450 Systems/00102 Party/00002 UI/00100 Summary_Top.rb

Overview

UI part displaying the generic information of the Pokemon in the Summary

Constant Summary collapse

NO_GENDER =

List of Pokemon that shouldn't show the gender sprite

%i[nidoranf nidoranm]

Constants inherited from SpriteStack

UI::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) ⇒ Summary_Top

Create a new Memo UI for the summary

Parameters:



8
9
10
11
# File 'scripts/01450 Systems/00102 Party/00002 UI/00100 Summary_Top.rb', line 8

def initialize(viewport)
  super(viewport, 0, 0, default_cache: :interface)
  init_sprite
end

Instance Method Details

#data=(pokemon)

Set the Pokemon shown

Parameters:



15
16
17
18
19
20
21
22
# File 'scripts/01450 Systems/00102 Party/00002 UI/00100 Summary_Top.rb', line 15

def data=(pokemon)
  super
  @gender.ox = 88 - @name.real_width
  @gender.visible = false if NO_GENDER.include?(pokemon.db_symbol) || pokemon.egg?
  @item.visible = false if pokemon.egg?
  @ball.set_bitmap(data_item(pokemon.captured_with).icon, :icon)
  @star.visible = pokemon.shiny && !pokemon.egg?
end

#update_graphics

Update the graphics



25
26
27
# File 'scripts/01450 Systems/00102 Party/00002 UI/00100 Summary_Top.rb', line 25

def update_graphics
  @sprite.update
end