Set Mouse Cursor Position[C2] [SOLVED]

  • 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?

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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)