PIXI.draggable icon indicating copy to clipboard operation
PIXI.draggable copied to clipboard

Uncaught TypeError

Open yahuarkuntur opened this issue 9 years ago • 5 comments

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!

yahuarkuntur avatar May 13 '15 16:05 yahuarkuntur

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

yahuarkuntur avatar May 14 '15 15:05 yahuarkuntur

thanks, i have the same issue too, SebastianNette please update this plugin to support pixi3

wlekin avatar Aug 03 '15 10:08 wlekin

you can check out https://github.com/GreyRook/PIXI.draggable - a version of PIXI.draggable working with pixi v3

FlorianLudwig avatar Aug 03 '15 12:08 FlorianLudwig

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?

torbenrohde avatar Aug 03 '15 14:08 torbenrohde

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.

FabianElsmer avatar Aug 03 '15 15:08 FabianElsmer