Class: UI::Shop::ItemDesc
- Inherits:
-
UI::SpriteStack
- Object
- UI::SpriteStack
- UI::Shop::ItemDesc
- Defined in:
- scripts/01450 Systems/00203 Shop/00002 ItemShop UI/00050 ItemDescWindow.rb
Constant Summary
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) ⇒ ItemDesc
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 item in stock.
-
#nb_item=(nb)
Update the number of currently possessed same item.
-
#text=(text)
Update the description text for the item.
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) ⇒ ItemDesc
Initialize the item description window graphisms and texts
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'scripts/01450 Systems/00203 Shop/00002 ItemShop UI/00050 ItemDescWindow.rb', line 6 def initialize() super(, 7, 144) @item_desc_window = add_background('shop/item_desc_window') @item_desc_name = add_text(22, 8, 150, 9, nil.to_s) @item_desc_name.draw_shadow = false @item_desc_text = add_text(10, 22, 286, 16, nil.to_s) @item_desc_text.draw_shadow = false @item_in_stock = add_text(23, 73, 145, 13, nil.to_s, color: 10) @item_in_stock.draw_shadow = false @img_item_in_bag = add_sprite(256, 76, 'shop/img_item_in_bag') @nb_item_bag = add_text(276, 76, 23, 8, nil.to_s, color: 10) @nb_item_bag.draw_shadow = false self.z = 4 end |
Instance Method Details
#name=(name)
Update the text of the item's name
23 24 25 |
# File 'scripts/01450 Systems/00203 Shop/00002 ItemShop UI/00050 ItemDescWindow.rb', line 23 def name=(name) @item_desc_name.text = name end |
#nb_in_stock=(nb)
Update the number of the item in stock
41 42 43 |
# File 'scripts/01450 Systems/00203 Shop/00002 ItemShop UI/00050 ItemDescWindow.rb', line 41 def nb_in_stock=(nb) @item_in_stock.text = ext_text(9003, 0) + nb.to_s end |
#nb_item=(nb)
Update the number of currently possessed same item
35 36 37 |
# File 'scripts/01450 Systems/00203 Shop/00002 ItemShop UI/00050 ItemDescWindow.rb', line 35 def nb_item=(nb) @nb_item_bag.text = nb.to_s end |
#text=(text)
Update the description text for the item
29 30 31 |
# File 'scripts/01450 Systems/00203 Shop/00002 ItemShop UI/00050 ItemDescWindow.rb', line 29 def text=(text) @item_desc_text.multiline_text = text end |