Rahman Fadhil Posted March 9, 2016 Share Posted March 9, 2016 Hi i have an error when i add this i get this on Panda Js cheatsheet var text = new game.BitmapText('Hello', { font: 'MyFont' }); text.position.set(100, 100); text.addTo(this.stage); can somebody fix this? Quote Link to comment Share on other sites More sharing options...
SkyzohKey Posted March 25, 2016 Share Posted March 25, 2016 Hi. Do u have a font called "MyFont" on your game folder ? Do you loaded it ? Quote Link to comment Share on other sites More sharing options...
Rahman Fadhil Posted March 28, 2016 Author Share Posted March 28, 2016 Hi ThanosS I dont have font called myFont, but i have delete the font code like this var text = new game.BitmapText('Hello'); text.position.set(100, 100); text.addTo(this.stage); but it doesn't work again... why? Quote Link to comment Share on other sites More sharing options...
SkyzohKey Posted March 28, 2016 Share Posted March 28, 2016 What version of Panda did u use ? The one on the master branch, or the develop one ? In the develop branch, BitmapText has been renamed into Text. You can use it like that: this.text = new game.Text('Hello', { font: 'Fjalla' }); // The font name can be found inside font.fnt this.text.anchorCenter(); this.text.position.set(100, 100); this.text.addTo(game.scene.stage); // or this.stage if you are on the current scene. You'll also need to have a font file in your media/ folder: media/font.fnt + media/font.png Then load it, like that: game.addAsset('font.fnt'); Quote Link to comment Share on other sites More sharing options...
Rahman Fadhil Posted March 29, 2016 Author Share Posted March 29, 2016 But, how can i get the font file? can you give me example? Quote Link to comment Share on other sites More sharing options...
SkyzohKey Posted March 30, 2016 Share Posted March 30, 2016 Yep, sure, here's the perfect tool to generate .fnt fonts → http://kvazars.com/littera/ Quote Link to comment Share on other sites More sharing options...
Rahman Fadhil Posted March 30, 2016 Author Share Posted March 30, 2016 Thanks ThanosS SkyzohKey 1 Quote Link to comment Share on other sites More sharing options...
SkyzohKey Posted March 30, 2016 Share Posted March 30, 2016 You're welcome. 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.