Class: UI::Hall_of_Fame::Trainer_Infos_Text_Box

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

Overview

Class that define the Trainer Infos text box stack

Constant Summary collapse

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

Constants inherited from SpriteStack

SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary collapse

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

Initialize the SpriteStack

Parameters:



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00023 Trainer_Infos_Text_Box.rb', line 18

def initialize(viewport)
  super(viewport, *initial_coordinates)
  @box = add_sprite(0, 0, box_filename)
  @name = add_text(*name_coordinates, $trainer.name, 0)
  @id_no = add_text(*id_no_coordinates,
                    format('%<text>s %<id>05d', text: text_get(34, 2), id: $trainer.id % 100_000), 0)
  @play_time = add_text(*play_time_coordinates, PFM.game_state.trainer.play_time_text, 2, type: Text)
  @name.fill_color = WHITE_COLOR
  @name.draw_shadow = false
  @name.opacity = 0
  @id_no.fill_color = WHITE_COLOR
  @id_no.draw_shadow = false
  @id_no.opacity = 0
  @play_time.fill_color = WHITE_COLOR
  @play_time.draw_shadow = false
  @play_time.opacity = 0
end

Instance Attribute Details

#id_noText

The id_no text

Returns:



10
11
12
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00023 Trainer_Infos_Text_Box.rb', line 10

def id_no
  @id_no
end

#nameText

The name text

Returns:



7
8
9
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00023 Trainer_Infos_Text_Box.rb', line 7

def name
  @name
end

#play_timeText

The play_time text

Returns:



13
14
15
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00023 Trainer_Infos_Text_Box.rb', line 13

def play_time
  @play_time
end

Instance Method Details

#box_filenameString

The base filename of the window

Returns:



44
45
46
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00023 Trainer_Infos_Text_Box.rb', line 44

def box_filename
  'hall_of_fame/text_window'
end

#id_no_coordinatesArray<Integer>

The base coordinates of the id_no text

Returns:

  • (Array<Integer>)

    the coordinates



62
63
64
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00023 Trainer_Infos_Text_Box.rb', line 62

def id_no_coordinates
  return 113, 5, 88, 16
end

#initial_coordinatesArray<Integer>

The SpriteStack initial coordinates

Returns:

  • (Array<Integer>)

    the coordinates



38
39
40
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00023 Trainer_Infos_Text_Box.rb', line 38

def initial_coordinates
  return 10, 240
end

#name_coordinatesArray<Integer>

The base coordinates of the name text

Returns:

  • (Array<Integer>)

    the coordinates



56
57
58
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00023 Trainer_Infos_Text_Box.rb', line 56

def name_coordinates
  return 42, 5, 57, 16
end

#play_time_coordinatesArray<Integer>

The base coordinates of the play_time text

Returns:

  • (Array<Integer>)

    the coordinates



68
69
70
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00023 Trainer_Infos_Text_Box.rb', line 68

def play_time_coordinates
  return 202, 5, 55, 16
end

#y_finalInteger

Get the constant's value

Returns:



50
51
52
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00023 Trainer_Infos_Text_Box.rb', line 50

def y_final
  Y_FINAL
end