Class: UI::VoltorbFlip::Cursor

Inherits:
Sprite show all
Defined in:
docs/4_Systems_900_Games.rb

Overview

Cursor shown in VoltorbFlip scene

Instance Attribute Summary collapse

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, #update

Methods inherited from LiteRGSS::Sprite

#set_origin, #set_position

Methods inherited from LiteRGSS::Disposable

#dispose, #disposed?

Constructor Details

#initialize(viewport) ⇒ Cursor

Create a new cursor

Parameters:



141
142
# File 'docs/4_Systems_900_Games.rb', line 141

def initialize(viewport)
end

Instance Attribute Details

#board_x ⇒ Integer (readonly)

The X coords on the board of the cursor

Returns:

  • (Integer)


132
133
134
# File 'docs/4_Systems_900_Games.rb', line 132

def board_x
  @board_x
end

#board_y ⇒ Integer (readonly)

The Y coords on the board of the cursor

Returns:

  • (Integer)


135
136
137
# File 'docs/4_Systems_900_Games.rb', line 135

def board_y
  @board_y
end

#mode ⇒ Symbol

The cursor mode :normal, :memo

Returns:

  • (Symbol)


138
139
140
# File 'docs/4_Systems_900_Games.rb', line 138

def mode
  @mode
end

Instance Method Details

#get_board_position(x, y) ⇒ Array(Integer, Integer)

Convert board coord in pixel coords

Parameters:

  • x (Integer) —

    X position on the board

  • y (Integer) —

    Y position on the board

Returns:

  • (Array(Integer, Integer)) —

    the pixel coordinate



151
152
# File 'docs/4_Systems_900_Games.rb', line 151

def get_board_position(x, y)
end

#move_on_board(dx, dy)

Start the cursor mouvement

Parameters:

  • dx (Integer) —

    the number of case to move in x

  • dy (Integer) —

    the number of case to move in y



156
157
# File 'docs/4_Systems_900_Games.rb', line 156

def move_on_board(dx, dy)
end

#moveto(board_x, board_y)

Move the cursor to a dedicated board coordinate

Parameters:

  • board_x (Integer)
  • board_y (Integer)


161
162
# File 'docs/4_Systems_900_Games.rb', line 161

def moveto(board_x, board_y)
end

#update_move ⇒ Boolean

Update the cursor mouvement, return true if the mouvement has been updated

Returns:

  • (Boolean)


145
146
# File 'docs/4_Systems_900_Games.rb', line 145

def update_move
end