Class: UI::Options::Arrow

Inherits:
Sprite show all
Defined in:
scripts/01450 Systems/00105 Options/00002 UI/00002 Arrow.rb

Overview

Arrow telling which option is selected

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
12
# File 'scripts/01450 Systems/00105 Options/00002 UI/00002 Arrow.rb', line 7

def initialize(viewport)
  super
  set_bitmap('options/arrow', :interface)
  set_origin(0, height / 2)
  @counter = 0
end

Instance Method Details

#update

Update the arrow animation



15
16
17
18
19
20
21
22
23
# File 'scripts/01450 Systems/00105 Options/00002 UI/00002 Arrow.rb', line 15

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