Class: UI::SaveSign

Inherits:
SpriteStack show all
Defined in:
docs/4_Systems_106_Save_Load.rb

Overview

UI element showing the save information

Constant Summary collapse

CORRUPTED_MESSAGE =

String shown when a save is corrupted

'Corrupted Save File'
SAVE_INDEX_MESSAGE =

String shown when a save is not corrupted and can be choosen

'Save %d'

Constants inherited from SpriteStack

UI::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, visual_index) ⇒ SaveSign

Create a new save sign

Parameters:

  • viewport (Viewport)
  • visual_index (Integer)


50
51
# File 'docs/4_Systems_106_Save_Load.rb', line 50

def initialize(viewport, visual_index)
end

Instance Attribute Details

#save_indexInteger

Get the index of the save

Returns:

  • (Integer)


39
40
41
# File 'docs/4_Systems_106_Save_Load.rb', line 39

def save_index
  @save_index
end

#visual_indexInteger

Get the visual index of the save sign

Returns:

  • (Integer)


42
43
44
# File 'docs/4_Systems_106_Save_Load.rb', line 42

def visual_index
  @visual_index
end

Instance Method Details

#animate_cursor

Animate the cursor when moving



68
69
# File 'docs/4_Systems_106_Save_Load.rb', line 68

def animate_cursor
end

#coordinates(visual_index) ⇒ Array<Integer>

Get the coordinate of the element based on its coordinate

Parameters:

  • visual_index (Integer)

    visual index of the UI element

Returns:

  • (Array<Integer>)


73
74
# File 'docs/4_Systems_106_Save_Load.rb', line 73

def coordinates(visual_index)
end

#data=(value)

Set the data of the SaveSign

Parameters:

  • value (PFM::GameState, Symbol)

    :new if new game, :corrupted if corrupted



54
55
# File 'docs/4_Systems_106_Save_Load.rb', line 54

def data=(value)
end

#done?Boolean

Tell if the animation is done

Returns:

  • (Boolean)


61
62
# File 'docs/4_Systems_106_Save_Load.rb', line 61

def done?
end

#move_to_visual_index(target_visual_index)

Start the animation of moving between index

Parameters:

  • target_visual_index (Integer)


65
66
# File 'docs/4_Systems_106_Save_Load.rb', line 65

def move_to_visual_index(target_visual_index)
end

#update

Update the animation



57
58
# File 'docs/4_Systems_106_Save_Load.rb', line 57

def update
end