Skip to main content
Participating Frequently
October 17, 2022
Question

How to have a symbol follow the mouse cursor

  • October 17, 2022
  • 1 reply
  • 354 views

Lets say I have a simple circle that I have converted to a symbol. How would I make it so that its location is where the mouse cursor is like in this animation:

https://editor.p5js.org/JWNimble/sketches/_nJzDc4Kj

    This topic has been closed for replies.

    1 reply

    Colin Holgate
    Inspiring
    October 17, 2022

    If you are doing an HTML5 Canvas project, looking at this page should help you to do various mouse related functions. The click and drag example on that page will be close to what you want:

     

    https://createjs.com/tutorials/Mouse%20Interaction/

    Participating Frequently
    October 17, 2022

    I figured it out, but that only works with shapes not symbols.

    kglad
    Community Expert
    Community Expert
    October 17, 2022

    again, please don't open duplicate threads.