Class: Rubygoo::MouseCursor

Inherits:
Widget
  • Object
show all
Defined in:
lib/rubygoo/mouse_cursor.rb

Constant Summary

Constants inherited from Widget

Widget::DEFAULT_PARAMS

Instance Attribute Summary

Attributes inherited from Widget

#app, #container, #enabled, #focus_priority, #focussed, #goo_id, #h, #mouse_over, #opts, #padding_left, #padding_top, #parent, #relative, #visible, #w, #x, #y

Instance Method Summary collapse

Methods inherited from Widget

#_draw, #_focus, #_key_pressed, #_key_released, #_mouse_down, #_mouse_drag, #_mouse_dragging, #_mouse_motion, #_mouse_up, #_unfocus, #_update, #contains?, #disable, #enable, #enabled?, #focus, #focussed?, #get, #get_color, goo_prop, #hide, inherited, #initialize, #key_pressed, #key_released, #modal?, #mouse_down, #mouse_drag, #mouse_dragging, #mouse_enter, #mouse_exit, #mouse_over?, #mouse_up, #removed, #show, #tab_to?, #theme_property, #unfocus, #update, #update_rect, #visible?

Methods included from Inflector

#camelize, #classify, #constantize, #dasherize, #demodulize, #foreign_key, #humanize, #inflections, #ordinalize, #pluralize, #singularize, #tableize, #titleize, #underscore

Constructor Details

This class inherits a constructor from Rubygoo::Widget

Instance Method Details

#addedObject



4
5
6
7
8
9
10
# File 'lib/rubygoo/mouse_cursor.rb', line 4

def added()
  cursor = theme_property :mouse_cursor
  @cursor_file = File.join(@app.theme_dir,cursor)
  @color = theme_property :color
  # use a 4px box for now
  @size = 4
end

#draw(screen) ⇒ Object



12
13
14
# File 'lib/rubygoo/mouse_cursor.rb', line 12

def draw(screen)
  screen.draw_box @x, @y, @x+@size, @y+@size, @color
end

#mouse_motion(event) ⇒ Object



16
17
18
19
# File 'lib/rubygoo/mouse_cursor.rb', line 16

def mouse_motion(event)
  @x = event.data[:x]
  @y = event.data[:y]
end