Any idea about transfer selection area coords to screen coords

Basically I’ve created a little extensions that offer a quick menu after I created a selection area, and it works just fine like this.

But the showcase of the menu depends on the mouse coords just after I finished create the area, it’s a little tricky and might work not as expected sometimes.

So I wonder if there’s a way I could transfer selection area to screen coords, so the menu could be placed in a precise position(e.g., bottom-center of seleciton area).

Hey, there is an attribute in Editor API that gives the mouse position on the screen.
That should help you do what you want.

Thanks, well I’ve already got the mouse pos, and the basic version of this extensions works fine.
What I was looking for is not the mouse pos, but like ‘the selection pos on canvas ’ transfer to ’ the pos on screen or window’.
Thanks all the same.

With Editor.mousePos and Editor.spritePos you should be able to see the correlation between the mouse pos from sprite and window pos. Maybe with that it may be possible to convert the selection coordinates afterwards :).

That’s interesting, I’ll see what I could do with them, ty!