Mouse positioning when it´s hijacked

This forum is currently in read-only mode.
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • Hi guys,

    I´m working on a fast-paced, run&gun platformer, players have to shoot fast and they tend to click outside window game. I tried to hijack mouse by setting its position to the center of the window (using Window object and so). Then I create a sprite I called "CustomMouse" and I did this to establish position:

    - CustomMouse x position: " clamp(.x+mousex-scrollx, scrollXLeft, scrollXRight)"

    • CustomMouse y position: " clamp(.y+mousey-scrolly, scrollYTop, scrollYBottom)"

    This works like a charm, but only if you keep moving the mouse, because it doesn´t scroll with the layer, mouse just remains in the last position it was when you moved, and I would like my CustomMouse also going along with the layer scroll.

    Any help is very appreciated, and you will gain a place in my heart and in the game credits.

    Thnx everyone in advance

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I`ve found this in the forum, maybe an alternative to my problem, but link is broken.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)