Class: UI::Shop::ItemDesc

Inherits:
UI::SpriteStack show all
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

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

Parameters:

  • viewport (Viewport)

    the viewport in which the SpriteStack will be displayed



6
7
8
9
10
# File 'scripts/01450 Systems/00203 Shop/00002 ItemShop UI/00050 ItemDescWindow.rb', line 6

def initialize(viewport)
  super(viewport, 7, 144)
  create_sprites
  self.z = 4
end

Instance Method Details

#name=(name)

Update the text of the item's name

Parameters:

  • name (String)

    the string of the item's name



14
15
16
# File 'scripts/01450 Systems/00203 Shop/00002 ItemShop UI/00050 ItemDescWindow.rb', line 14

def name=(name)
  @item_desc_name.text = name
end

#nb_in_stock=(nb)

Update the number of the item in stock

Parameters:

  • nb (Integer)

    the number of the currently shown item in stock



32
33
34
# File 'scripts/01450 Systems/00203 Shop/00002 ItemShop UI/00050 ItemDescWindow.rb', line 32

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

Parameters:

  • nb (Integer)

    the number of the currrently shown item in the player bag



26
27
28
# File 'scripts/01450 Systems/00203 Shop/00002 ItemShop UI/00050 ItemDescWindow.rb', line 26

def nb_item=(nb)
  @nb_item_bag.text = nb.to_s
end

#text=(text)

Update the description text for the item

Parameters:

  • text (String)

    the string of the item's description



20
21
22
# File 'scripts/01450 Systems/00203 Shop/00002 ItemShop UI/00050 ItemDescWindow.rb', line 20

def text=(text)
  @item_desc_text.multiline_text = text
end