I am creating a game that requires diagonal dragging of an object.
Technically, how I want it to work is by scaling the object diagonally to make a rectangle or square.
Is there any way to code for it?
So its still a bit unclear to me if you want to drag the sprite along a diagonal or if you want to scale the sprite by dragging like a window resize.
I've decided to go for the 2nd one :-D
What it does is when you click the sprite you can move your mouse to scale it keeping the aspect ratio. To do that I simply use the x coordinate of the mouse to scale both x and y equally. Hope that helps :-)
var spriteScale = false;
var spriteScaleStartX, spriteStartSizeX;
var spriteScaleStartY,