Set Mouse Cursor Position[C2] [SOLVED]

0 favourites
  • 6 posts
From the Asset Store
Cursor Magic
$2 USD
80% off
Mouse cursor is something that the player controls and sees all the time, that's why it is so important to make it cool!
  • How would I set the position of the mouse cursor/touch position to a sprite in C2?

    Found an old post by the Spriter Dev on it, but expired link.

    If the two aren't separated by events, can I safely assume that mouse cursor position = touch position by default?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What do you mean by setting the position of the cursor or a touch position? There isn't a feature to move the mouse cursor, and I don't think there's an API to force the user's finger to move But it sounds like you might be after the CanvasToLayerX/Y system expressions.

  • Ashley

    lucid

    I mean this.

    Lucid seems to have done it. I just need the capx.

    Basically I need to position the mouse/touch cursor once on key press at specific coordinates in game, say sprite.x, sprite.y.

    After that, business as usual, player input controls the mouse cursor.

    I need this because I have an ugly jump when switching between control systems, from keyboard/touch to XPAD.

    Because in XPAD 360 Controller mode (as opposed to keyboard/touch modes, which are mouse based), the analog stick steers the cursor, so when player switches the control modes, cursor position is different and I need the mouse cursor to jump to that position.

  • Lucid did it in Construct Classic. You can't do it in C2 because web browsers don't let you move the mouse cursor around.

  • Doh! Ugly jump it is then.

    I suppose I could do exclusive control systems at start, but that takes all the fun out of it (can't switch to keyboard in middle of game if you want to).

    Thanks.

  • This turned out not to be necessary.

    I found a workaround.

    Actually made for more dynamic game play.

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