Skip to content

Conversation

donpark
Copy link

@donpark donpark commented Apr 29, 2015

In particular, PIXI.js v3 makes addEventListener calls on canvas element.

Note that this is a partial fix only to get past runtime errors. Firing canvas element events PIXI.js uses will complete the fix.

@drkibitz
Copy link

@donpark Is the problem that events are only allowed on document without these changes?

@drkibitz
Copy link

Although I like these changes myself, just wanted to note that you can also change the interactive target element here:
https://github.com/GoodBoyDigital/pixi.js/blob/master/src/interaction/InteractionManager.js#L179

Did you try setting the InteractionManager's element to document?

@donpark
Copy link
Author

donpark commented May 23, 2015

Is the problem that events are only allowed on document without these changes?

Problem was that PIXI.js expects canvas element to have addEventListener method. I didn't bother looking into which events it was dependent on so this is just superficial patch to avoid PIXI.js breaking during initialization.

Did you try setting the InteractionManager's element to document?

No. This was just a probe to see viability of using Ejecta w/PIXI.js so I just took the first solution that worked.

Please do feel free to ignore my PR. It's intended just as a FYI since it's incomplete and, as you pointed out, may not be the optimal solution. :-)

finscn pushed a commit to finscn/Ejecta that referenced this pull request Sep 11, 2015
This pr is like  phoboslab#510  , but simple and better , I think .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants