Class: UI::VoltorbFlip::Texts

Inherits:
SpriteStack show all
Defined in:
scripts/01450 Systems/09000 Games/00002 VoltorbFlip/02200 VoltorbFlipSprites.rb

Overview

Object that show a text using a method of the data object sent

Constant Summary collapse

COIN_CASE_FORMAT =

Format of the coin case text

'%07d'
COIN_GAIN_FORMAT =

Format of the coin gain text

'%05d'

Constants inherited from SpriteStack

SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary

Attributes inherited from SpriteStack

#animated, #data, #moving, #stack, #viewport, #x, #y

Instance Method Summary collapse

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

Create a new VoltorbFlip text handler

Parameters:



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'scripts/01450 Systems/09000 Games/00002 VoltorbFlip/02200 VoltorbFlipSprites.rb', line 11

def initialize(viewport)
  super(viewport)
  @font_id = 20

  @title = add_text(0, 0, 320, 35, '', 1, color: 10)
  @title.bold = true
  @title.size = 22

  @coin_case = add_text(227, 172, 81, 24, '', 2, color: 7)
  @coin_case.bold = true
  @coin_case.size = 22

  @coin_gain = add_text(248, 203, 60, 24, '', 2, color: 7)
  @coin_gain.bold = true
  @coin_gain.size = 22

  @level = add_text(203, 203, 24, 24, '', color: 7)
  @level.bold = true
  @level.size = 22
end

Instance Method Details

#coin_case=(value)

Set the coin case content value

Parameters:



40
41
42
# File 'scripts/01450 Systems/09000 Games/00002 VoltorbFlip/02200 VoltorbFlipSprites.rb', line 40

def coin_case=(value)
  @coin_case.text = format(COIN_CASE_FORMAT, value.to_i)
end

#coin_gain=(value)

Set the gain value

Parameters:



46
47
48
# File 'scripts/01450 Systems/09000 Games/00002 VoltorbFlip/02200 VoltorbFlipSprites.rb', line 46

def coin_gain=(value)
  @coin_gain.text = format(COIN_GAIN_FORMAT, value.to_i)
end

#level=(value)

Set the level value

Parameters:



52
53
54
# File 'scripts/01450 Systems/09000 Games/00002 VoltorbFlip/02200 VoltorbFlipSprites.rb', line 52

def level=(value)
  @level.text = format(ext_text(9000, 145), value) # "N#{value}"
end

#title=(value)

Set the title

Parameters:



34
35
36
# File 'scripts/01450 Systems/09000 Games/00002 VoltorbFlip/02200 VoltorbFlipSprites.rb', line 34

def title=(value)
  @title.text = value.upcase
end