This can all be done with regular code. Here is a basic code for being able to do this.
Interface
DraggableElement
isDragEl = true
onMouseDown(pClient, pX, pY, pButton)
if (this.isDragEl && pButton === 1 && pClient.isDragEl)
pClient.isDragEl.xOff = pX
pClient.isDragEl.yOff = pY
Client
onMouseDown(pD, pX, pY, pButton)
if (pD.isDragEl && pButton === 1)
this.isDragEl = {'el': pD}
onMouseMove(pD, pX, pY)
if (this.isDragEl)
this.isDragEl.el.setPos(pX - this.isDragEl.xOff, pY - this.isDragEl.yOff)
onMouseUp(pD, pX, pY, pButton)
if (this.isDragEl && pButton === 1)
this.isDragEl = null
As for the link interfaces together thing, just simply use some sort of identifier to specify what elements should be linked together and some sort of array to loop through so you can move them all together.
The code I provided is very basic and not optimized for your specific project, so you may need to make changes and optimizations.
And it would also be nice if we could attach certain skin elements to another skin element, so you can drag them all at the same time.
Interface DraggableElement isDragEl = true onMouseDown(pClient, pX, pY, pButton) if (this.isDragEl && pButton === 1 && pClient.isDragEl) pClient.isDragEl.xOff = pX pClient.isDragEl.yOff = pY Client onMouseDown(pD, pX, pY, pButton) if (pD.isDragEl && pButton === 1) this.isDragEl = {'el': pD} onMouseMove(pD, pX, pY) if (this.isDragEl) this.isDragEl.el.setPos(pX - this.isDragEl.xOff, pY - this.isDragEl.yOff) onMouseUp(pD, pX, pY, pButton) if (this.isDragEl && pButton === 1) this.isDragEl = null
As for the link interfaces together thing, just simply use some sort of identifier to specify what elements should be linked together and some sort of array to loop through so you can move them all together.
The code I provided is very basic and not optimized for your specific project, so you may need to make changes and optimizations.