PIXI.draggable
PIXI.draggable copied to clipboard
Uncaught TypeError
I am getting the following error:
Uncaught TypeError: Cannot read property 'prototype' of undefined pixi.draggable.min.js:75 (anonymous function)
Pixi.js 3.0.3 - ✰ WebGL ✰
This is on Chromium Version 41.0.2272.76 Ubuntu 14.04 (64-bit)
Thanks!
It seems this version of PIXI.draggable is not yet compatible with PIXI 3.
Changing some PIXI 2 to PIXI 3 API calls seems to work:
PIXI.InteractionManager => PIXI.interaction.InteractionManager
thanks, i have the same issue too, SebastianNette please update this plugin to support pixi3
you can check out https://github.com/GreyRook/PIXI.draggable - a version of PIXI.draggable working with pixi v3
Awesome, thanks.
I was trying to convert it myself. But with my feeble PIXI skills I don't think I was even close to fixing it ;-)
I just tried replacing the original draggable with this, but unfortunately I can't get it to work.
Looking at the code, It seems to me that you might need to supply and instance of PIXI.DragAndDropManager
and set it as the manager
option for .draggable
This is my feeble (failed) attempt:
var dragAndDropManager = new PIXI.DragAndDropManager(PIXI.interaction.InteractionManager)
this.mySuperDragger.draggable({
manager: dragAndDropManager,
distance: 1,
axis: 'x'
/* etc. etc. */
}
I get renderer undefined at
var topDisplayObject = this.interactionManager.renderer._lastObjectRendered
And dragElement undefined at
ox = item.dragElement.worldTransform.tx,
Any hints on what I might be doing wrong?
The InteractionManager is now a plugin in PIXI v3, which afaik means you will have to instantiate it: var manager = new PIXI.interaction.InteractionManager(renderer, options);
Not sure what the other issue is about exactly, I guess it is just a follow up error, however the code we added might need a refactoring or two to better fit into the existing PIXI.draggable code.