Class: UI::Hall_of_Fame::Pokemon_Text_Box
- Inherits:
-
SpriteStack
- Object
- SpriteStack
- UI::Hall_of_Fame::Pokemon_Text_Box
- Defined in:
- scripts/01450 Systems/00300 Hall of fame/00002 UI/00004 Pokemon_Text_Box.rb
Overview
Class that define the Pokemon text box stack
Constant Summary collapse
Constants inherited from SpriteStack
Instance Attribute Summary
Attributes inherited from SpriteStack
#animated, #data, #moving, #stack, #viewport, #x, #y
Instance Method Summary collapse
-
#bmp_filename ⇒ String
The base filename of the window.
-
#initialize(viewport, pkm) ⇒ Pokemon_Text_Box
constructor
Initialize the SpriteStack.
-
#lvl_text_coordinates ⇒ Array<Integer>
The base coordinates of the level text.
-
#name_text_coordinates ⇒ Array<Integer>
The base coordinates of the name text.
-
#number_of_types ⇒ Integer
Check how many types the game has.
-
#spritesheet_coordinates ⇒ Array<Integer>
The SpriteStack initial coordinates.
-
#width ⇒ Integer
Get the width of the box.
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, pkm) ⇒ Pokemon_Text_Box
Initialize the SpriteStack
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00004 Pokemon_Text_Box.rb', line 9 def initialize(, pkm) super(, *spritesheet_coordinates) @box = add_sprite(0, 0, bmp_filename, 1, number_of_types, type: SpriteSheet) @box.mirror = true @box.sy = pkm.type1 @name_text = add_text(*name_text_coordinates, pkm.given_name) @name_text.fill_color = WHITE_COLOR @name_text.draw_shadow = false @lvl_text = add_text(*lvl_text_coordinates, parse_text(27, 29) + " #{pkm.level}", 2) @lvl_text.fill_color = WHITE_COLOR @lvl_text.draw_shadow = false end |
Instance Method Details
#bmp_filename ⇒ String
The base filename of the window
24 25 26 |
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00004 Pokemon_Text_Box.rb', line 24 def bmp_filename 'hall_of_fame/type_window' end |
#lvl_text_coordinates ⇒ Array<Integer>
The base coordinates of the level text
36 37 38 |
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00004 Pokemon_Text_Box.rb', line 36 def lvl_text_coordinates return 121, 5, 35, 16 end |
#name_text_coordinates ⇒ Array<Integer>
The base coordinates of the name text
30 31 32 |
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00004 Pokemon_Text_Box.rb', line 30 def name_text_coordinates return 8, 5, 98, 16 end |
#number_of_types ⇒ Integer
Check how many types the game has
48 49 50 |
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00004 Pokemon_Text_Box.rb', line 48 def number_of_types return each_data_type.size end |
#spritesheet_coordinates ⇒ Array<Integer>
The SpriteStack initial coordinates
54 55 56 |
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00004 Pokemon_Text_Box.rb', line 54 def spritesheet_coordinates return 320, 200 end |
#width ⇒ Integer
Get the width of the box
42 43 44 |
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00004 Pokemon_Text_Box.rb', line 42 def width @box.width end |