Tilde Posted August 9, 2015 Share Posted August 9, 2015 What I'm trying to do here is load a RetroFont once, then write various things on various parts of the screen. This is for my game's menu. I've tried a bunch of different things, but no matter what I do, instead of writing various things to the screen, every image becomes the last-set message. computerScreen = this.add.image(0,0, 'computerScreen'); computerText = this.add.retroFont('computerFont', 4, 5, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890.,!?:@'\"^_-#+ ", 100, 1, 1); //computerText.setText("Test 1!\nThe quick brown fox jumped over the lazy dog. No text wrapping!!!", true, 1, 1, Phaser.RetroFont.ALIGN_LEFT, true); computerText.buildRetroFontText("Test 1!\nThe quick brown fox jumped over the lazy dog. No text wrapping!!!", 12, 41, 0); missionStatement = game.add.image(12, 41, computerText); computerText.setText(1, true, 1, 1, Phaser.RetroFont.ALIGN_LEFT, true); missionNumber = this.add.image(210, 44, computerText); //computerText.pasteLine("Mission Name", 210, 44, 1); computerText.setText("Mission Name", true, 1, 1, Phaser.RetroFont.ALIGN_LEFT, true); missionName = this.add.image(210, 44, computerText); computerText.setText("TEREK-STAR\nYOA3805@2274", true, 1, 1, Phaser.RetroFont.ALIGN_LEFT, true); //computerText.pasteLine("SOLO ARMADA\n22@789626PF", 166, 21, 1); computerText.setText("0.0.1", false, 1, 1, Phaser.RetroFont.ALIGN_LEFT, true); versionNumber = this.add.image(262, 204, computerText);Check out the result here: http://www.hardmodeorders.com/slapspark/slapspark.html As you can see, it says "0.0.1" in a bunch of places, even though I only wanted that to show in the lower-right. What's the deal with this? Do I really have to add another retrofont for every single new message? Link to comment Share on other sites More sharing options...
Tilde Posted August 10, 2015 Author Share Posted August 10, 2015 I guess I can bite the bullet and keep adding the same font over and over again if I really have to. It just seems like I'm not supposed to do it that way. Link to comment Share on other sites More sharing options...
drhayes Posted August 10, 2015 Share Posted August 10, 2015 I think that's the intent with RetroFont, to add a completely new instance for every instance of text you want to display. What you're seeing now is the intended behavior; the texture is getting updated in-place and updating across all the Phaser.Images you've added. EDIT: One way to think of it is that it's not a "font", per se, it's a "text". If that helps. Tilde 1 Link to comment Share on other sites More sharing options...
Tilde Posted August 10, 2015 Author Share Posted August 10, 2015 Alright, gotcha. Thanks for the help! One more question while I'm here: Is there any word wrap support for retrofont? Link to comment Share on other sites More sharing options...
drhayes Posted August 11, 2015 Share Posted August 11, 2015 Not that I know of, not built-in. Tilde 1 Link to comment Share on other sites More sharing options...
Recommended Posts