nocaoper

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. I've tested a variable with and without this and I think it's because this allow the variable to be accessible in other methods. Lets say we have this code: create: function() { this.background=this.game.add.sprite(0,0,'myBackground'); }, update: function() { console.log(this.background); } I tried to replace <<this.background>> with <<var background=...>> in the create function. The result: I get undefined in the update function. This is absolutely needed.
  2. I have the same problem, I could not load font-awesome in my game. The solution I've found is to simply 1. create a start menu state for my game. 2. In that start menu, I call the font I'm going to use. As expected it does not work. 3. When I get into the game state, it works. Explanation: The browser only loads font-awesome on the first use. So you have to call it before using it. The solution was found in this article: https://hacks.mozilla.org/2016/06/webfont-preloading-for-html5-games/ Bonus tip: If you're a font awesome pro user the font is: "32px Font Awesome 5 Pro" instead of "32px FontAwesome", you can check in the css file search for @font-face, there is an entry called font-family, use the name displayed.