Class: UI::TitleControls

Inherits:
SpriteStack show all
Defined in:
scripts/01450 Systems/00001 Title/00002 UI_Title/00001 TitleControls.rb

Overview

UI component showing the controls of the title screen (Play / Credits)

Constant Summary

Constants inherited from SpriteStack

SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary collapse

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_animation, #update_position, #visible, #visible=, #with_cache, #with_font, #with_surface, #z, #z=

Constructor Details

#initialize(viewport) ⇒ TitleControls

Returns a new instance of TitleControls.



14
15
16
17
18
19
20
# File 'scripts/01450 Systems/00001 Title/00002 UI_Title/00001 TitleControls.rb', line 14

def initialize(viewport)
  super(viewport, 0, 240, default_cache: :title)
  create_sprites
  self.index = 0
  @wait_duration = Configs.scene_title_config.control_wait || 0.5
  create_animation
end

Instance Attribute Details

#credit_bgSprite (readonly)

Get the credit bg button

Returns:



12
13
14
# File 'scripts/01450 Systems/00001 Title/00002 UI_Title/00001 TitleControls.rb', line 12

def credit_bg
  @credit_bg
end

#indexInteger

Get the index of the selection

Returns:



6
7
8
# File 'scripts/01450 Systems/00001 Title/00002 UI_Title/00001 TitleControls.rb', line 6

def index
  @index
end

#play_bgSprite (readonly)

Get the play bg button

Returns:



9
10
11
# File 'scripts/01450 Systems/00001 Title/00002 UI_Title/00001 TitleControls.rb', line 9

def play_bg
  @play_bg
end

Instance Method Details

#done?Boolean

Tell if the controls are done transitionning

Returns:

  • (Boolean)


38
39
40
# File 'scripts/01450 Systems/00001 Title/00002 UI_Title/00001 TitleControls.rb', line 38

def done?
  @animation.done?
end

#update

Update the animation



31
32
33
34
# File 'scripts/01450 Systems/00001 Title/00002 UI_Title/00001 TitleControls.rb', line 31

def update
  super
  @animation.update
end