Class: UI::Storage::Cursor
- Inherits:
-
ShaderedSprite
- Object
- LiteRGSS::Disposable
- LiteRGSS::Drawable
- LiteRGSS::Sprite
- LiteRGSS::ShaderedSprite
- Sprite
- ShaderedSprite
- UI::Storage::Cursor
- Defined in:
- scripts/01450 Systems/00200 Storage/00002 UI_Storage/00008 Cursor.rb
Overview
Class responsive of showing the cursor
Constant Summary collapse
- BOX_INITIAL_POSITION =
Box initial position
[17, 42]
- PARTY_POSITIONS =
Party positions
[ [233, 50], [281, 66], [233, 98], [281, 115], [233, 146], [281, 162] ]
- ARROW_IMAGES =
List of graphics depending on the selection mode
{ battle: 'pc/arrow_red', pokemon: 'pc/arrow_blue', grouped: 'pc/arrow_green', item: 'pc/arrow_yellow' }
Instance Attribute Summary collapse
-
#inbox ⇒ Boolean
Get the inbox property /!\ Always update this before index.
-
#index ⇒ Integer
Get the index.
-
#mode ⇒ Symbol
Get the current mode.
-
#select_box ⇒ Boolean
Get the select box mode.
-
#selection_mode ⇒ Symbol
Get the current selection mode.
Attributes inherited from LiteRGSS::ShaderedSprite
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
-
#done? ⇒ Boolean
Tell if the animation is done.
-
#force_index(inbox, index)
Force an index (mouse operation).
-
#initialize(viewport, index, inbox, mode_handler) ⇒ Cursor
constructor
Create a new cusror object.
-
#max_index ⇒ Integer
Get the max index.
-
#update
Update the animation.
Methods inherited from Sprite
#load, #mouse_in?, #set_origin_div, #set_rect, #set_rect_div, #set_z, #simple_mouse_in?, #translate_mouse_coords
Methods inherited from LiteRGSS::Sprite
new, #set_origin, #set_position
Methods inherited from LiteRGSS::Disposable
Constructor Details
#initialize(viewport, index, inbox, mode_handler) ⇒ Cursor
Create a new cusror object
35 36 37 38 39 40 41 42 43 44 45 |
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00008 Cursor.rb', line 35 def initialize(, index, inbox, mode_handler) super() @max_index_box = PFM.storage_class.box_size - 1 @max_index_battle = PARTY_POSITIONS.size - 1 @inbox = inbox @index = index % (max_index + 1) mode_handler.add_selection_mode_ui(self) mode_handler.add_mode_ui(self) update_position set_z(31) end |
Instance Attribute Details
#inbox ⇒ Boolean
Get the inbox property /!\ Always update this before index
10 11 12 |
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00008 Cursor.rb', line 10 def inbox @inbox end |
#index ⇒ Integer
Get the index
7 8 9 |
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00008 Cursor.rb', line 7 def index @index end |
#mode ⇒ Symbol
Get the current mode
19 20 21 |
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00008 Cursor.rb', line 19 def mode @mode end |
#select_box ⇒ Boolean
Get the select box mode
13 14 15 |
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00008 Cursor.rb', line 13 def select_box @select_box end |
#selection_mode ⇒ Symbol
Get the current selection mode
16 17 18 |
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00008 Cursor.rb', line 16 def selection_mode @selection_mode end |
Instance Method Details
#done? ⇒ Boolean
Tell if the animation is done
54 55 56 |
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00008 Cursor.rb', line 54 def done? return @animation ? @animation.done? : true end |
#force_index(inbox, index)
Force an index (mouse operation)
74 75 76 77 78 79 80 |
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00008 Cursor.rb', line 74 def force_index(inbox, index) @select_box = false @inbox = inbox @index = index % (max_index + 1) update_position self.visible = false end |
#max_index ⇒ Integer
Get the max index
60 61 62 |
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00008 Cursor.rb', line 60 def max_index return @inbox ? @max_index_box : @max_index_battle end |
#update
Update the animation
48 49 50 |
# File 'scripts/01450 Systems/00200 Storage/00002 UI_Storage/00008 Cursor.rb', line 48 def update @animation&.update end |