Class: UI::Shop::MoneyWindow

Inherits:
UI::SpriteStack show all
Defined in:
scripts/01450 Systems/00203 Shop/00002 ItemShop UI/00010 MoneyWindow.rb

Constant Summary collapse

COORD_X =
7
COORD_Y =
4
BLACK_COLOR =
Color.new(0, 0, 0)
WHITE_COLOR =
Color.new(255, 255, 255)

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

Initializing the money window graphics and texts

Parameters:

  • viewport (Viewport)

    viewport in which the SpriteStack will be displayed



11
12
13
14
15
16
17
18
19
20
21
# File 'scripts/01450 Systems/00203 Shop/00002 ItemShop UI/00010 MoneyWindow.rb', line 11

def initialize(viewport)
  super(viewport, COORD_X, COORD_Y)
  @money_window = add_background('shop/money_window')
  @money_text = add_text(5, 7, 34, 11, parse_text(11, 6) + ' :')
  @money_text.fill_color = WHITE_COLOR
  @money_text.draw_shadow = false
  @money_quantity = add_text(52, 8, 66, 9, nil.to_s, 2)
  @money_quantity.fill_color = WHITE_COLOR
  @money_quantity.draw_shadow = false
  self.z = 4
end

Instance Method Details

#text=(text)

Update the money text

Parameters:

  • text (String)

    the new string to display



25
26
27
# File 'scripts/01450 Systems/00203 Shop/00002 ItemShop UI/00010 MoneyWindow.rb', line 25

def text=(text)
  @money_quantity.text = text
end