Class: UI::InfoBox::ScoreBar

Inherits:
SpriteStack show all
Defined in:
docs/6_Contest_01_Scene.rb

Overview

Class that represents the score bar in the info box

Constant Summary

Constants inherited from SpriteStack

SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary collapse

Attributes inherited from SpriteStack

#animated, #data, #font_id, #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) ⇒ ScoreBar

Create a new ScoreBar

Parameters:



456
457
# File 'docs/6_Contest_01_Scene.rb', line 456

def initialize(viewport)
end

Instance Attribute Details

#current_score ⇒ Integer

Current score value

Returns:

  • (Integer)


450
451
452
# File 'docs/6_Contest_01_Scene.rb', line 450

def current_score
  @current_score
end

#score_hearts ⇒ Array<SpriteSheet> (readonly)

Score hearts sprites

Returns:



453
454
455
# File 'docs/6_Contest_01_Scene.rb', line 453

def score_hearts
  @score_hearts
end

Instance Method Details

#change_score(score) ⇒ Yuki::AnimationMixin

Change the score shown in the score bar

Parameters:

  • score (Integer) —

    Change to apply to the score

Returns:



464
465
# File 'docs/6_Contest_01_Scene.rb', line 464

def change_score(score)
end

#reset

Reset the score bar to empty



459
460
# File 'docs/6_Contest_01_Scene.rb', line 459

def reset
end