I usually use the following formula on mobile and desktop web apps and it's not so bad.
I got some performance issues only if the display object contains a lot of other texts and display objects .
Here an example to enable the drag'n'drop to a loaded bitmap.
var canvas;
var stage;
init = function () {
canvas = document.getElementById("canvas");
stage = new createjs.Stage(canvas);
displayPicture ("YOUR PATH");
}
displayPicture = function (imgPath) {
var image = new Image();
image.onload = function () {
// Create a Bitmap from the loaded image
var img = new createjs.Bitmap(event.target)
// scale it
img.scaleX = img.scaleY = 0.5;
/// Add to display list
stage.addChild(img);
//Enable Drag'n'Drop
enableDrag(img);
// Render Stage
stage.update();
}
// Load the image
image.src = imgPath;
}
enableDrag = function (item) {
// OnPress event handler
item.onPress = function(evt) {
var offset = { x:item.x-evt.stageX,
y:item.y-evt.stageY};
// Bring to front
stage.addChild(item);
// Mouse Move event handler
evt.onMouseMove = function(ev) {
item.x = ev.stageX+offset.x;
item.y = ev.stageY+offset.y;
stage.update();
}
}
}
init()