lean / phaser-es6-webpack

A bootstrap project for create games with Phaser + ES6 + Webpack.
MIT License
1.28k stars 319 forks source link

How to use phaser plugins #67

Closed henriquecustodia closed 5 years ago

henriquecustodia commented 6 years ago

Hi, I would like know how to use the phaser-sound-analyser with this boilerplate. I'm getting some error on try.

I'm saw that comment but it's confuse for me.

Can somebody shows a explicit solution with an examples if possible?

Thanks!

RenaudRohlinger commented 6 years ago

I did it for a project long time ago like that :

import '../audio/Audio' 

const soundAnalyse = this.game.plugins.add(new Phaser.Plugin.SoundAnalyse(this))
this.soundAnalyseSprite = soundAnalyse.add.soundAnalyseSprite(0, 0, this.game.width, this.game.height, 'holyother', false, this._onDecodeFinish, this)

where my Audio file was just a copy of https://github.com/KaktusFlame/phaser-sound-analyser/blob/master/js/plugin/SoundAnalyse/SoundAnalyse.js file

henriquecustodia commented 6 years ago

@RenaudROHLINGER Thank you!