Class: UI::Bag::Arrow

Inherits:
Sprite show all
Defined in:
scripts/01450 Systems/00103 Bag/00002 UI/00070 Arrow.rb

Overview

Arrow telling which item is selected

Direct Known Subclasses

Shop::Arrow

Instance Attribute Summary

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 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

#dispose, #disposed?

Constructor Details

#initialize(viewport) ⇒ Arrow

Create a new arrow

Parameters:



7
8
9
10
11
# File 'scripts/01450 Systems/00103 Bag/00002 UI/00070 Arrow.rb', line 7

def initialize(viewport)
  super
  @counter = 0
  init_sprite
end

Instance Method Details

#update

Update the arrow animation



14
15
16
17
18
19
20
21
22
# File 'scripts/01450 Systems/00103 Bag/00002 UI/00070 Arrow.rb', line 14

def update
  if @counter == 30
    self.x -= 1
  elsif @counter == 60
    self.x += 1
    @counter = 0
  end
  @counter += 1
end