浏览代码

Made Mouse.Location read/write so it can WarpMouse.

Mark Sibly 8 年之前
父节点
当前提交
544857eecc
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      modules/mojo/input/mouse.monkey2

+ 6 - 0
modules/mojo/input/mouse.monkey2

@@ -104,9 +104,15 @@ Class MouseDevice Extends InputDevice
 	End
 	End
 
 
 	#rem monkeydoc The mouse location.
 	#rem monkeydoc The mouse location.
+	
+	This property may be written to warp the mouse to a new location.
+	
 	#end
 	#end
 	Property Location:Vec2i()
 	Property Location:Vec2i()
 		Return _location
 		Return _location
+	Setter( location:Vec2i )
+		_location=location
+		SDL_WarpMouseInWindow( Null,location.x,location.y )
 	End
 	End
 	
 	
 	#rem monkeydoc The mouse wheel delta x value since the last app update.
 	#rem monkeydoc The mouse wheel delta x value since the last app update.