SC2Mapster Forums

Development > Triggers

(solved) How to place mouse cursor to screen coordinate?

  • 8 posts
    #1 Dec 29, 2012 at 09:54 UTC - 0 likes

    Subj. Saw it done in photon bikes map, but didn't find how to do it.

    #2 Dec 29, 2012 at 11:29 UTC - 0 likes

    @Zolden: Go

    what do you mean exactly? do you have a screen?

    #3 Dec 29, 2012 at 12:39 UTC - 0 likes

    I mean teleport mouse cursor to the center of the screen. Not by moving the mouse, but by a trigger.

    #4 Dec 29, 2012 at 14:16 UTC - 0 likes

    Lock mouse relative mode has a bug that sometimes shows the mouse cursor locked in the center of the screen.

    Besides that i wouldnt know any function that moves the mouse cursor.

    http://i55.tinypic.com/wio5t0.jpg

    Starcraft Universe lead programmer

    #5 Dec 29, 2012 at 14:30 UTC - 0 likes
    Quote from Mille25: Go

    Lock mouse relative mode

    I think it's what I need, don't care about the bug. Is it trigger action or a function? Didn't find it in my russian editor. Can you tell me its name if raw (Ctrl+D) mode on? Or paste the function from Ctrl+F11 code?

    #6 Dec 29, 2012 at 16:00 UTC - 0 likes
    native void CameraForceMouseRelative(int player, bool locked);
    
    #7 Dec 29, 2012 at 18:21 UTC - 0 likes

    Thank you, it worked.

    But now "mouse moved" event doesn't happen. How can I get mouse movement info?

    UPD: another question: how can I force mouse cursor to come from-behind the left border if it touches the right one and vice versa? I want it to act like mario in the nes mario game. Or, in other words, I want screen to be like a cylinder instead of square.

    UPD 2: Ok, I decided not to use that thing, just checking mouse move and translating screen coordinates into map coordinates.

    Last edited Dec 29, 2012 by Zolden
    #8 Jan 09, 2013 at 11:18 UTC - 0 likes

    But now "mouse moved" event doesn't happen. How can I get mouse movement info?

    //I suppose you cant since the mouse is now locked in the middle of the screen.

    UPD: another question: how can I force mouse cursor to come from-behind the left border if it touches the right one and vice versa? I want it to act like mario in the nes mario game. Or, in other words, I want screen to be like a cylinder instead of square.

    //Like ive said, its not possible to directly influence the position of the mouse cursor. Therefore smth like that is not possible.

  • 8 posts

You must login to post a comment. Don't have an account? Register to get one!