SomeDude Posted June 21, 2018 Share Posted June 21, 2018 Hi, I am trying to get Angular 6 with phaser running properly, but i am unable to do so. Does someone know if there is a way to get this two things running together? Link to comment Share on other sites More sharing options...
thosakwe Posted June 23, 2018 Share Posted June 23, 2018 That's actually a pretty vague question, as it's unclear what you mean by "Angular 6 with Phaser." Which version of Phaser? Are you using a module bundler? What are you trying to do? Embed a Phaser game in an Angular component? Send data from Phaser to Angular? Send data from Angular to Phaser? Use Phaser to cause an Angular component to be rendered? Angular TypeScript, or Angular Dart? Without information, it's hard to really know what to say... That being said, I'm assuming that you're trying to embed a Phaser game within an Angular component. You can pass a <canvas> element in your Phaser game configuration, so if your Angular template has a <canvas>, you can grab a reference to it, and then initialize Phaser. If you download the Phaser TypeScript typings from the phaser3-docs Github repo, then you should be able to use Angular and Phaser in the same project without much hassle. You might, though, need some way to tell Angular to never update your component's state, otherwise a UI update might trigger a recreation of your canvas, and start a whole new game (though you can technically work around this and start specific game states depending on Angular's state). Link to comment Share on other sites More sharing options...
Fairydhwen Posted July 30, 2018 Share Posted July 30, 2018 You can chack my workaround here : Link to comment Share on other sites More sharing options...
jasonmcleod Posted September 17, 2018 Share Posted September 17, 2018 I am in the same boat. I have things working, but I feel like i am attaching stuff to angular/phaser contexts in a really confusing way.. May have the same issues with any other js framework. Did you end up getting anything running? Link to comment Share on other sites More sharing options...
jdnichollsc Posted October 2, 2019 Share Posted October 2, 2019 Hey guys, I recommend you this WebComponent I created to be able to integrate Phaser 3 with any Framework like Angular, React, etc easily => https://github.com/proyecto26/ion-phaser Check the demos of the repository and let me know any doubt Regards Link to comment Share on other sites More sharing options...
Recommended Posts