Jump to content

Sprite.crop question


bubamara
 Share

Recommended Posts

Hi,

 

when I have sprite created from frame and apply crop on it, I would expect, that only portion of actual frame will be cropped

var mainMenu = _game.add.sprite(0, 0 , 'atlas');mainMenu.frameName = 'mainMenu.png';mainMenu.cropEnabled = true;mainMenu.crop = new Phaser.Rectangle(10,10,100,100);

Instead of that, result is texture area cropped from whole atlas. Is this intentional?

 

Thanks

Link to comment
Share on other sites

  • 5 weeks later...
  • 10 months later...

Hey, I've been skipping this problem by using separate images for any texture I would need to crop, but now I would like to crop an Image that is part of a TextureAtlas.

 

Is there a way to do this with the built in Phaser functionality? It seems, just like hackenstein said, that the crop function will be applied to the whole atlas instead of the image frame.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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