0 Favourites

How do I position sprite on mouse

  • i want to make my crosshair position on my mouse, so i make the code

    Every tick >> crosshair set position to mouse. AbsoluteX, mouse.AbsoluteY

    but it ended up like this

    the red circle is my mouse position and the crosshair a way off from it.

    how to solve this ?

  • There are two ways of doing this.

    1. On start of layout -> Mouse|Set cursor from sprite (in this case, make sure the crosshair sprite is not larger than 64x64).

    2. Every tick -> crosshair set position to X: Mouse.X, Y: Mouse.Y (make sure you set to X and Y, not AbsoluteX and AbsoluteY)

    For the first option, see here for more info: (under Mouse Actions).

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • There are two ways of doing this.

    1. On start of layout -> Mouse|Set cursor from sprite (in this case, make sure the crosshair sprite is not larger than 64x64).

    2. Every tick -> crosshair set position to X: Mouse.X, Y: Mouse.Y (make sure you set to X and Y, not AbsoluteX and AbsoluteY)

    For the first option, see here for more info: (under Mouse Actions).

    thanks for reply

    the first option is work really well.

    but the second option is weird, because i am already try that before. the crosshair actually spawn under my cursor and its WAY off from the Absolute position. its weird

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