Jump to content

Phaser.BitmapData: Streching and antialiasing


digitsensitive
 Share

Recommended Posts

Hi!

I have the following problem. I have a *.png File with a size of 400x300 pixels.

Now i want to stretch this (double) to fit the game screen of 800x600 pixels using bitmapData. Everything works fine but when doing this, everything looks blurred and this is not what I want.

private m_land: Phaser.BitmapData;

this.load.image('land', 'assets/levels/land.png');

this.m_land = this.add.bitmapData(800, 600);
this.m_land.draw('land', 0, 0, 800, 600);
this.m_land.update();
this.m_land.addToWorld(0, 0, 0, 0, 1, 1);

I tried in the draw function to set roundPix to true and false, it did not change anything.

Looking forward for your help! Thank you.

Link to comment
Share on other sites

Thank you samme! I tried all around and finally I did find a solution.

private m_land: Phaser.BitmapData;

this.load.image('land', 'assets/levels/land.png');

this.m_land = this.add.bitmapData(800, 600);
this.m_land.smoothed = false;

this.m_land.draw('land', 0, 0, 800, 600);
this.m_land.update();
this.m_land.addToWorld(0, 0, 0, 0, 1, 1);

The order is the import part here. this.m_land.smoothed = false; NEEDS to be before the drawing obviously.

 

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...