I think this is more of a math question than actual programming, but I want to hold and drag a sprite while maintaining the base in fixed position. I've managed to get this working for stretching left,right,up,down, but I'm having trouble doing it diagonally. Anyone knows how to do this?
`drag up
if dragDirection$="U"
SetSpritePosition(1,30,30-(oldPointY#-GetRawMouseY()))
SetSpriteSize(1, width#, height#+(oldPointY#-GetRawMouseY()))
endif
`drag down
if dragDirection$="D"
SetSpritePosition(1,30,30)
SetSpriteSize(1, width#, height#+(GetRawMouseY()-oldPointY#))
endif
`drag right
if dragDirection$="R"
SetSpritePosition(1,30,30)
SetSpriteSize(1, width#+(GetRawMouseX()-oldPointX#), height#)
endif
`drag left
if dragDirection$="L"
SetSpritePosition(1,30-(oldPointX#-GetRawMouseX()),30)
SetSpriteSize(1, width#+(oldPointX#-GetRawMouseX()), height#)
endif
`drag upper right
if dragDirection$="UR"
SetSpriteAngle(1,135)
SetSpritePosition(1,20,25)
`SetSpriteSize(1, width#+(GetRawMouseX()-oldPointX#), height#+(oldPointY#-GetRawMouseY()))
endif