Gravix

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. Gravix

    Call a function in Phaser from external HTML

    Thanks for the help, appreciate it! This has been resolved. I forgot that I could just use the click events... Oops. My solution was quite simple, in case anyone else has the same question: this.loginButton = document.getElementById('login-btn') as HTMLLinkElement; this.loginButton.addEventListener('click', (e) => this.login(e));
  2. Hello, I'm fairly new to development with Phaser (TypeScript). I've made a simple login screen in HTML, and I'm trying to make the "Log In" button which is in the external HTML call a function in my Phaser game. This is the button that will call the function: <button onclick="login()">Log In</button> Where in my project should I write the function "login", and how can I call it when I click the button? Any help would be greatly appreciated. 😃 I'm using this as a base for my project (I purchased his book): https://github.com/code0wl/Multiplayer-Phaser-game