Class: UI::Hall_of_Fame::Dead_Pokemon_Text

Inherits:
SpriteStack show all
Defined in:
scripts/01450 Systems/00300 Hall of fame/00002 UI/00011 Dead_Pokemon_Text.rb

Overview

Class that define the Dead Pokemon text

Constant Summary collapse

WHITE_COLOR =
Color.new(255, 255, 255)

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, x, y) ⇒ Dead_Pokemon_Text

Initialize the SpriteStack

Parameters:



10
11
12
13
14
15
16
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00011 Dead_Pokemon_Text.rb', line 10

def initialize(viewport, x, y)
  super(viewport, x, y)
  @box = add_sprite(0, 0, bmp_filename)
  @text = add_text(*text_coordinate, nil.to_s, 1)
  @text.fill_color = WHITE_COLOR
  @text.draw_shadow = false
end

Instance Method Details

#bmp_filenameString

The base filename of the window

Returns:



20
21
22
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00011 Dead_Pokemon_Text.rb', line 20

def bmp_filename
  'hall_of_fame/text_window'
end

#text=(pkm)

Change the text according to the data sent

Parameters:

  • pkm (PFM::Pokemon)

    the dead Pokemon we want the name of



32
33
34
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00011 Dead_Pokemon_Text.rb', line 32

def text=(pkm)
  @text.text = ext_text(9004, 0) + ' ' + pkm.given_name
end

#text_coordinateArray<Integer>

The base coordinates of the text

Returns:

  • (Array<Integer>)

    the coordinates



26
27
28
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00011 Dead_Pokemon_Text.rb', line 26

def text_coordinate
  return 39, 5, 222, 16
end