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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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