SteveMavic Posted May 30, 2016 Share Posted May 30, 2016 Hello. As I mentioned in title, setting text bounds causes game getting crashes. var bar = game.add.graphics(); bar.beginFill(0x000000, 0.2); bar.drawRect(FirstCave.position.x, 100, FirstCave.width, 230); var style = { font: "bold 25px Arial", fill: "#fff", boundsAlignH: "center", boundsAlignV: "middle" }; CaveName = game.add.text(FirstCave.position.x, 100, "Kopalnia Złota", style); //CaveName.setTextBounds(0, 100, 100, 100); Code is from THAT example. Did I made mistake somewhere? Link to comment Share on other sites More sharing options...
Umz Posted May 31, 2016 Share Posted May 31, 2016 What does your console log say? I'm not too sure, because the code on example works but.. To me it looks like you haven't finished the bar above it. There's no call to bar.endFill() after drawRect(). That would be my best guess. Link to comment Share on other sites More sharing options...
SteveMavic Posted May 31, 2016 Author Share Posted May 31, 2016 TypeError: CaveName.setTextBounds is not a function Link to comment Share on other sites More sharing options...
SteveMavic Posted May 31, 2016 Author Share Posted May 31, 2016 I'm really a novice programmer and thanks to your idea realized that when I worked with the tutorial I downloaded an older (much older) version of the Phaser. All the problems have disappeared. Even if unconsciously, thank you for your help Sorry for my English Link to comment Share on other sites More sharing options...
Recommended Posts