Class: UI::Storage::SelectionModeSprite

Inherits:
SpriteSheet show all
Defined in:
scripts/01450 Systems/00200 Storage/00002 UI_Storage/00002 SelectionModeSprite.rb

Overview

Sprite showing the current selection mode

Constant Summary collapse

SHEET_INDEXES =

List of sheet index for all modes

{ detailed: 0, fast: 1, grouped: 2 }
SHEET_SIZE =

Constant telling how much section there's in the sprite

[1, 7]

Instance Attribute Summary collapse

Attributes inherited from SpriteSheet

#nb_x, #nb_y, #sx, #sy

Attributes inherited from LiteRGSS::ShaderedSprite

#blendmode, #shader

Attributes inherited from LiteRGSS::Sprite

#__index__, #angle, #bitmap, #height, #mirror, #opacity, #ox, #oy, #src_rect, #viewport, #visible, #width, #x, #y, #z, #zoom, #zoom_x, #zoom_y

Instance Method Summary collapse

Methods inherited from SpriteSheet

#bitmap=, #select

Methods inherited from Sprite

#load, #mouse_in?, #set_origin_div, #set_rect, #set_rect_div, #set_z, #simple_mouse_in?, #translate_mouse_coords, #update

Methods inherited from LiteRGSS::Sprite

new, #set_origin, #set_position

Methods inherited from LiteRGSS::Disposable

#dispose, #disposed?

Constructor Details

#initialize(viewport, mode_handler) ⇒ SelectionModeSprite

Create a new SelectionModeSprite

Parameters:

  • viewport (Viewport)

    viewport used to display the sprite

  • mode_handler (ModeHandler)

    class responsive of handling the mode



15
16
17
18
19
20
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00002 SelectionModeSprite.rb', line 15

def initialize(viewport, mode_handler)
  super(viewport, *SHEET_SIZE)
  load_texture
  mode_handler.add_selection_mode_ui(self)
  position_sprite
end

Instance Attribute Details

#selection_modeSymbol

Get the current mode

Returns:

  • (Symbol)

    :detailed, :fast, :grouped



7
8
9
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00002 SelectionModeSprite.rb', line 7

def selection_mode
  @selection_mode
end