Class: UI::Shop::PkmDesc
- Inherits:
-
UI::SpriteStack
- Object
- UI::SpriteStack
- UI::Shop::PkmDesc
- Defined in:
- scripts/01450 Systems/00203 Shop/00002 PokemonShop UI/00020 ItemDescWindow.rb
Constant Summary collapse
Constants inherited from UI::SpriteStack
UI::SpriteStack::NO_INITIAL_IMAGE
Instance Attribute Summary
Attributes inherited from UI::SpriteStack
#animated, #data, #moving, #stack, #viewport, #x, #y
Instance Method Summary collapse
-
#initialize(viewport) ⇒ PkmDesc
constructor
Initialize the item description window graphisms and texts.
-
#name=(name)
Update the text of the item's name.
-
#nb_in_stock=(nb)
Update the number of the Pokémon in stock.
-
#species=(species)
Update the species text for the Pokemon.
-
#text=(text)
Update the level text for the Pokemon.
Methods inherited from UI::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) ⇒ PkmDesc
Initialize the item description window graphisms and texts
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'scripts/01450 Systems/00203 Shop/00002 PokemonShop UI/00020 ItemDescWindow.rb', line 7 def initialize() super(, 7, 184) @item_desc_window = add_background('shop/pkm_desc_window') @item_desc_name = add_text(20, 9, 150, 9, nil.to_s) @item_desc_name.draw_shadow = false @item_desc_name.fill_color = WHITE_COLOR @item_desc_text = add_text(14, 26, 286, 16, nil.to_s) @item_desc_text.draw_shadow = false @item_desc_species = add_text(58, 26, 286, 16, nil.to_s) @item_desc_species.draw_shadow = false @item_in_stock = add_text(205, 27, 145, 13, nil.to_s, color: 10) @item_in_stock.draw_shadow = false self.z = 4 end |
Instance Method Details
#name=(name)
Update the text of the item's name
24 25 26 |
# File 'scripts/01450 Systems/00203 Shop/00002 PokemonShop UI/00020 ItemDescWindow.rb', line 24 def name=(name) @item_desc_name.text = name end |
#nb_in_stock=(nb)
Update the number of the Pokémon in stock
42 43 44 |
# File 'scripts/01450 Systems/00203 Shop/00002 PokemonShop UI/00020 ItemDescWindow.rb', line 42 def nb_in_stock=(nb) @item_in_stock.text = ext_text(9003, 0) + nb.to_s end |
#species=(species)
Update the species text for the Pokemon
36 37 38 |
# File 'scripts/01450 Systems/00203 Shop/00002 PokemonShop UI/00020 ItemDescWindow.rb', line 36 def species=(species) @item_desc_species.text = species end |
#text=(text)
Update the level text for the Pokemon
30 31 32 |
# File 'scripts/01450 Systems/00203 Shop/00002 PokemonShop UI/00020 ItemDescWindow.rb', line 30 def text=(text) @item_desc_text.text = parse_text(27, 29) + " #{text}" end |