Class: Fidgit::Cursor
- Defined in:
- lib/fidgit/cursor.rb
Constant Summary collapse
- ARROW =
'arrow.png'
- HAND =
'hand.png'
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(options = {}) ⇒ Cursor
constructor
A new instance of Cursor.
-
#inside_window? ⇒ Boolean
Is the mouse pointer position inside the game window pane?.
- #update ⇒ Object
Constructor Details
Instance Method Details
#draw ⇒ Object
33 34 35 36 |
# File 'lib/fidgit/cursor.rb', line 33 def draw # Prevent system and game mouse from being shown at the same time. super if inside_window? and $window.current_game_state.is_a? GuiState and not $window.needs_cursor? end |
#inside_window? ⇒ Boolean
Is the mouse pointer position inside the game window pane?
21 22 23 |
# File 'lib/fidgit/cursor.rb', line 21 def inside_window? x >= 0 and y >= 0 and x < $window.width and y < $window.height end |
#update ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/fidgit/cursor.rb', line 25 def update self.x, self.y = $window.mouse_x, $window.mouse_y super nil end |