Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Text cropping


MoreK
 Share

Recommended Posts

Howdi!
I have just recently starting to learn Phaser and now I'm finalizing my new online game. I'm really impressed on what Phaser can do and the help I have found from this community has been really valuable.

 

Now, the question. I'm trying to implement text cropping and according to the documentation it should be straigh forward. However I can't make it work, maybe I'm missing something? I couldn't find any similar cases from earlier posts either.

 

This is basically what I'm trying to do:

function create() {    text = game.add.text(100, 100, 'Testin 1-2-3 Testing 1-2-3 Testing 1-2-3', {fontSize:18, fill: "#ffffff"});    var cropRect = new Phaser.Rectangle(0, 0, 100, 20);    text.crop(cropRect);    }

You can try it out in Phaser sandbox yourself, it shows a blank screen.

 

Any ideas?

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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