Well do you want it to be smooth or jump there? If you want it to just jump, have a filled region stretched over the view (same size), set its zdepth to 0, and add this code.
filled -> Mouse Button Down (left) -> Script Editor
- Code: Select all
view.x=xmouse-width/2;
view.y=ymouse-height/2;
You could parent that actor to the view, but due to zdepth issues, I'd either use creator, or something like this.
filled -> Draw Actor -> Script Editor
- Code: Select all
x=view.x;
y=view.y;
If you want it to be smooth movement, you should have this as your mouse button down event.
filled -> Mouse Button Down (left) -> Script Editor
- Code: Select all
MoveTo("view", -width/2, -height/2, 10, "Mouse Position", "(none)");
Just to note since the view's and filled actor's width and height are the same you don't need to specify view.width or view.height.