Class: UI::Storage::Composition

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

Overview

Stack responsive of showing the full PC UI

Constant Summary collapse

OFFSET_Y_CURSOR =

Y Offset of the cursor while inside of the box

[0, -1, -2, -3, -4, -5, -5, -4, -3, -2, -1, 0]
OFFSET_Y_CURSOR_OUT_OF_THE_BOX =

Y Offset of the cursor while outside of the box

[15, 30, 63, 79, 111, 126]

Constants inherited from UI::SpriteStack

UI::SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary collapse

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

Constructor Details

#initialize(viewport, mode, selection_mode) ⇒ Composition

Create a new Composition

Parameters:

  • viewport (Viewport)

    viewport used to display the sprites

  • mode (Symbol)

    :pokemon, :item, :battle or :box

  • selection_mode (Symbol)

    :detailed, :fast or :grouped



632
633
# File 'docs/4_Systems_200_Storage.rb', line 632

def initialize(viewport, mode, selection_mode)
end

Instance Attribute Details

#box_indexInteger (readonly)

Get the current box index

Returns:

  • (Integer)


614
615
616
# File 'docs/4_Systems_200_Storage.rb', line 614

def box_index
  @box_index
end

#cursor_handlerCursorHandler (readonly)

Get the cursor object

Returns:



620
621
622
# File 'docs/4_Systems_200_Storage.rb', line 620

def cursor_handler
  @cursor_handler
end

#mode_handlerModeHandler (readonly)

Get the mode handler

Returns:



605
606
607
# File 'docs/4_Systems_200_Storage.rb', line 605

def mode_handler
  @mode_handler
end

#partyArray<PFM::Pokemon>

Get the party

Returns:



608
609
610
# File 'docs/4_Systems_200_Storage.rb', line 608

def party
  @party
end

#selection_handlerSelectionHandler (readonly)

Get the selection handler

Returns:



623
624
625
# File 'docs/4_Systems_200_Storage.rb', line 623

def selection_handler
  @selection_handler
end

#storagePFM::Storage

Get the storage object

Returns:



611
612
613
# File 'docs/4_Systems_200_Storage.rb', line 611

def storage
  @storage
end

#summarySummary (readonly)

Get the summary object

Returns:



617
618
619
# File 'docs/4_Systems_200_Storage.rb', line 617

def summary
  @summary
end

Instance Method Details

#animate_left_arrow(middle_animation = nil)

Start animation for left arrow

Parameters:



647
648
# File 'docs/4_Systems_200_Storage.rb', line 647

def animate_left_arrow(middle_animation = nil)
end

#animate_right_arrow(middle_animation = nil)

Start animation for right arrow

Parameters:



643
644
# File 'docs/4_Systems_200_Storage.rb', line 643

def animate_right_arrow(middle_animation = nil)
end

#done?boolean

Tell if the animation is done

Returns:

  • (boolean)


639
640
# File 'docs/4_Systems_200_Storage.rb', line 639

def done?
end

#hovering_box_option?Boolean

Tell if the box option is hovered

Returns:

  • (Boolean)


671
672
# File 'docs/4_Systems_200_Storage.rb', line 671

def hovering_box_option?
end

#hovering_left_arrow?Boolean

Tell if the left arrow is hovered

Returns:

  • (Boolean)


679
680
# File 'docs/4_Systems_200_Storage.rb', line 679

def hovering_left_arrow?
end

#hovering_mode_indicator?Boolean

Tell if the mouse hover the mode indicator

Returns:

  • (Boolean)


663
664
# File 'docs/4_Systems_200_Storage.rb', line 663

def hovering_mode_indicator?
end

#hovering_party_left_arrow?Boolean

Tell if the left arrow of party stack is hovered

Returns:

  • (Boolean)


687
688
# File 'docs/4_Systems_200_Storage.rb', line 687

def hovering_party_left_arrow?
end

#hovering_party_right_arrow?Boolean

Tell if the right arrow of party stack is hovered

Returns:

  • (Boolean)


683
684
# File 'docs/4_Systems_200_Storage.rb', line 683

def hovering_party_right_arrow?
end

#hovering_pokemon_sprite?Boolean

Tell if the mouse is hovering a pokemon sprite & update cursor index in consequence

Returns:

  • (Boolean)


659
660
# File 'docs/4_Systems_200_Storage.rb', line 659

def hovering_pokemon_sprite?
end

#hovering_right_arrow?Boolean

Tell if the right arrow is hovered

Returns:

  • (Boolean)


675
676
# File 'docs/4_Systems_200_Storage.rb', line 675

def hovering_right_arrow?
end

#hovering_selection_mode_indicator?Boolean

Tell if the mouse hover the selection mode indicator

Returns:

  • (Boolean)


667
668
# File 'docs/4_Systems_200_Storage.rb', line 667

def hovering_selection_mode_indicator?
end

#update

Update the composition state



635
636
# File 'docs/4_Systems_200_Storage.rb', line 635

def update
end