I’m wondering how do I go about dragging containers.
I’ve had it setup as such so that there would be text below above a sprite and that on drag they would move together. However, it doesnt seem to work at all and does not drag. If someone could point me into the right direction that would be appreciated. Thanks for reading.
// spriite and txt defined here.
var container = this.add.container(500,500);
container.add(sprite);
container.add(txt);
container.setSize(250,250);
container.setInteractive({ draggable: true });
this.scene.input.on(‘drag’,function (pointer,gameObject,dragX,dragY){
gameObject.x=dragX;
gameObject.y=dragY;
});