Class: UI::Bag::ScrollBar

Inherits:
SpriteStack show all
Defined in:
scripts/01300 UI/00300 Bag/00030 ScrollBar.rb

Constant Summary collapse

HEIGHT =

Number of pixel the scrollbar use to move the button

160
BASE_Y =

Base Y for the scrollbar

36
BASE_X =

BASE X for the scrollbar

309
BACKGROUND =

Background of the scrollbar

'bag/scroll'
BUTTON =

Image of the button

'bag/button_scroll'

Constants inherited from SpriteStack

SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary collapse

Attributes inherited from SpriteStack

#animated, #data, #moving, #stack, #viewport, #x, #y

Instance Method Summary collapse

Methods inherited from 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, #update_animation, #update_position, #visible, #visible=, #with_cache, #with_font, #with_surface, #z, #z=

Constructor Details

#initialize(viewport) ⇒ ScrollBar

Create a new scrollbar

Parameters:



20
21
22
23
24
25
# File 'scripts/01300 UI/00300 Bag/00030 ScrollBar.rb', line 20

def initialize(viewport)
  super(viewport, BASE_X, BASE_Y)
  @index = 0
  @max_index = 1
  init_sprite
end

Instance Attribute Details

#indexInteger

Returns current index of the scrollbar.

Returns:

  • (Integer)

    current index of the scrollbar



5
6
7
# File 'scripts/01300 UI/00300 Bag/00030 ScrollBar.rb', line 5

def index
  @index
end

#max_indexInteger

Returns number of possible indexes.

Returns:

  • (Integer)

    number of possible indexes



7
8
9
# File 'scripts/01300 UI/00300 Bag/00030 ScrollBar.rb', line 7

def max_index
  @max_index
end