Jump to content

Setting Text Bounds causes game crashing


SteveMavic
 Share

Recommended Posts

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

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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...