Jump to content

Crop Resize in 1.1


{ESO}
 Share

Recommended Posts

Hi,

after the changes of the 23 in the crop i can see better performances. Great work!

Anyway i've now an issue with this new version. Basically if now i want to give a width and an height to an image cropped, this will resize the main image an not only the crop area as was before.

 

Here the two code example:

1.0 before of 23oct (working):

// get the full imagevar runnerhead = game.add.sprite(runnerbody.x + 7, game.world.height - runnerbody.height, 'headrunner');// crop the headrunnerhead.crop = new Phaser.Rectangle(runnerImg.selected.x,runnerImg.selected.y,runnerImg.selected.w,runnerImg.selected.h);// resize the headrunnerhead.width = 40;runnerhead.height = 50;runnerhead.body.setSize(40,50);

1.1 (not working):

// get the full imagevar runnerhead = game.add.sprite(runnerbody.x + 7, game.world.height - runnerbody.height, 'headrunner');// crop the headrunnerhead.cropEnabled = true;runnerhead.crop.x = runnerImg.selected.x;runnerhead.crop.y = runnerImg.selected.y;runnerhead.crop.width = runnerImg.selected.w;runnerhead.crop.height = runnerImg.selected.h;// resize the headrunnerhead.width = 40;runnerhead.height = 50;runnerhead.body.setSize(40,50);

Do you have some solution?

 

Thanks :)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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