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

Hello samme! Thank you for your answer. Unfortunately it is not possible to access the scale.set() function when using BitmapData. This function is only accessible when using Phaser.Sprite. But I need a BitmapData because I need the circle-Effect for destroying terrain. Do you have any other idea?

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

 Share

  • Recently Browsing   0 members

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