Module: AMS::Cursor
- Defined in:
- cursor.rb
Class Method Summary (collapse)
-
+ (Boolean) clear_clip
Unclip cursor.
-
+ (Boolean) clip_to_main_window
Clip cursor to main window.
-
+ (Boolean) clip_to_viewport
Clip cursor to view window.
-
+ (Array<Fixnum>) get_clip_rect(mode = 1)
Get upper-left and lower-right coordinates of the cursor clip rectangle.
-
+ (Array<Fixnum>) get_pos(mode = 1)
Get cursor position.
-
+ (Boolean) is_main_window_target?
Determine whether cursor is pointing at the main window.
-
+ (Boolean) is_viewport_target?
Determine whether cursor is within the view client area.
-
+ (Boolean) is_visible?
Determine whether cursor is visible.
-
+ (Boolean) set_clip_rect(x1, y1, x2, y2, mode = 1)
Set upper-left and lower-right coordinates of the cursor clip rectangle.
-
+ (Boolean) set_pos(x, y, mode = 1)
Set cursor position.
-
+ (Boolean) show(state)
Show/Hide cursor.
Class Method Details
+ (Boolean) clear_clip
Unclip cursor.
109 110 111 |
# File 'cursor.rb', line 109 def clear_clip AMS::C.clear_clip_cursor() end |
+ (Boolean) clip_to_main_window
Clip cursor to main window.
95 96 97 |
# File 'cursor.rb', line 95 def clip_to_main_window AMS::C.set_cursor_clip_rect(*AMS::C.get_window_rect(AMS::C.get_main_window())) end |
+ (Boolean) clip_to_viewport
Clip cursor to view window.
102 103 104 |
# File 'cursor.rb', line 102 def AMS::C.set_cursor_clip_rect(*AMS::C.()) end |
+ (Array<Fixnum>) get_clip_rect(mode = 1)
Get upper-left and lower-right coordinates of the cursor clip rectangle.
58 59 60 61 62 63 64 65 66 67 68 |
# File 'cursor.rb', line 58 def get_clip_rect(mode = 1) rect = AMS::C.get_cursor_clip_rect() if mode == 2 srect = AMS::C.() rect[0] -= srect[0] rect[1] -= srect[1] rect[2] -= srect[0] rect[3] -= srect[1] end rect end |
+ (Array<Fixnum>) get_pos(mode = 1)
Get cursor position.
25 26 27 28 29 30 31 32 33 |
# File 'cursor.rb', line 25 def get_pos(mode = 1) x,y = AMS::C.get_cursor_pos() if mode == 2 srect = AMS::C.() x -= srect[0] y -= srect[1] end return [x,y] end |
+ (Boolean) is_main_window_target?
Determine whether cursor is pointing at the main window.
116 117 118 119 |
# File 'cursor.rb', line 116 def is_main_window_target? x,y = AMS::C.get_cursor_pos() AMS::C.get_main_window() == AMS::C.get_window_from_point(x,y) end |
+ (Boolean) is_viewport_target?
Determine whether cursor is within the view client area.
124 125 126 127 128 |
# File 'cursor.rb', line 124 def rect = AMS::C.() x,y = AMS::C.get_cursor_pos() x.between?(rect[0], rect[2]) && y.between?(rect[1], rect[3]) end |
+ (Boolean) is_visible?
Determine whether cursor is visible.
15 16 17 |
# File 'cursor.rb', line 15 def is_visible? AMS::C.is_cursor_visible?() end |
+ (Boolean) set_clip_rect(x1, y1, x2, y2, mode = 1)
Set upper-left and lower-right coordinates of the cursor clip rectangle.
80 81 82 83 84 85 86 87 88 89 90 |
# File 'cursor.rb', line 80 def set_clip_rect(x1, y1, x2, y2, mode = 1) rect = AMS::C.get_cursor_clip_rect() if mode == 2 srect = AMS::C.() x1 += srect[0] y1 += srect[1] x2 += srect[0] y2 += srect[1] end AMS::C.set_cursor_clip_rect(x1, y1, x2, y2) end |
+ (Boolean) set_pos(x, y, mode = 1)
Set cursor position.
43 44 45 46 47 48 49 50 |
# File 'cursor.rb', line 43 def set_pos(x, y, mode = 1) if mode == 2 srect = AMS::C.() x += srect[0] y += srect[1] end AMS::C.set_cursor_pos(x,y) end |
+ (Boolean) show(state)
Show/Hide cursor.
8 9 10 |
# File 'cursor.rb', line 8 def show(state) AMS::C.set_cursor_visible(state) end |