Moving UI sprite with mouse

I am trying to move a sprite on 2D Canvas
I don’t know how to convert mouse input to 2D screen, is there a method for that inside PC ?

We don’t unfortunately.

The closest with got is a drag helper class that can be created to make an UI component draggable with the mouse or touch.

You can dig through the engine to see how it handles the Screen to UI Screen conversion: engine/element-drag-helper.js at master · playcanvas/engine · GitHub

1 Like

What type of movement, if this is 2D and NOT on the 2D screen component, then I might be able to help