jayantbh Posted May 19, 2021 Share Posted May 19, 2021 I'm following the melonJS guides on space invaders and platformer. Tried to add a HUD component with score on it. Obtained the font files from their github: https://github.com/melonjs/tutorial-platformer/tree/28425a946836e21e58e8fbc443f380b990e7f527/tutorial_step6/data/fnt The text does show up, but it appears white, and I can't change the color on it. This is what I've tried: // 1 this.font = new me.BitmapText(0, 0, { font: "PressStart2P", fillStyle: "#000000", textAlign: "right", textBaseline: "bottom", }); // 2 this.font.tint.setColor(255, 128, 128); // 3 this.font.fillStyle = "#000000" (and "#000", and "black") // 4 this.font.fillStyle = me.Color(0, 0, 0); What am I doing wrong? Quote Link to comment Share on other sites More sharing options...
obiot Posted October 13, 2021 Share Posted October 13, 2021 assuming you use at least version 8 of melonJS they are all valid (fillStyle is internally an alias to tint). see here what we use in the example : https://github.com/melonjs/examples/blob/master/examples/text/main.js#L109 but I guess that since one year (...) you figured it out ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.