digitsensitive Posted February 25, 2017 Share Posted February 25, 2017 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 More sharing options...
samme Posted February 25, 2017 Share Posted February 25, 2017 Do you just need to scale it? var land = this.add.image('land'); land.scale.set(2); Link to comment Share on other sites More sharing options...
digitsensitive Posted February 25, 2017 Author Share Posted February 25, 2017 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 More sharing options...
samme Posted February 25, 2017 Share Posted February 25, 2017 console.assert( this.m_land.game.antialias === false ); console.assert( this.m_land.smoothed === false ); console.assert( this.m_land.addToWorld(0, 0, 0, 0, 1, 1).smoothed === false ); Link to comment Share on other sites More sharing options...
digitsensitive Posted February 26, 2017 Author Share Posted February 26, 2017 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 More sharing options...
Recommended Posts