Hi,
I’m trying to understand how to call a Phaser function (JS) from a regular HTML / JS function. I can do it the other way round, but I’m at a loss as to how to call it from the HTML page. It’s for a mute button that I want in the site navigation – not within Phaser itself.
In Phaser:
mutesound() {
this.scene.sound.setMute(true);
if (this.scene.sound.mute) {
this.scene.sound.setMute(false);
}
}
In the HTML page:
<a href="javascript:void(0);" onclick="mute()" style="color:#fff;">Mute</a>
<script>
function mute() {
mutesound(); //THIS DOES NOT WORK BUT WHAT SHOULD IT BE??
}
</script>
Thanks!