freddyInKorea Posted March 16, 2019 Share Posted March 16, 2019 Hello guys, I realize that my sprites were beautiful when I zoom in and quite ugly when I zoom out, so I decided to define two sprites to keep a good quality in zoom out or in: this._zoomOut[name] = new PIXI.Sprite(PIXI.Texture.fromImage(name,undefined,undefined,0.5)); this._zoomIn[name] = new PIXI.Sprite(PIXI.Texture.fromImage(name,undefined,undefined,1)); when I use this two lines of code separately it works well. But when I use both of them, the second call doesn't apply the 4th parameter "sourceScale". It means this._zoomIn[name] receives a sprite from a texture with 0.5 of sourceScale too. That's super weird, are there any cache to clear? ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
freddyInKorea Posted March 16, 2019 Author Share Posted March 16, 2019 my mistake it was because of cache issue: this._zoomOut[name] = new PIXI.Sprite(PIXI.Texture.fromImage(name,undefined,undefined,0.5)); PIXI.Texture.removeTextureFromCache(name); this._zoomIn[name] = new PIXI.Sprite(PIXI.Texture.fromImage(name,undefined,undefined,1)); ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.