b0y2k Posted July 28, 2017 Share Posted July 28, 2017 Lo guys, I have been doing performance upgrades to my current game. I have combined the graphics into big spritesheets which has helped with frame rates and general performance, great. Problem i now have is that the game some times flickers when updating the sprites. I'm sure this is from setting the sprites to the big spritesheet and a slight lag between setting .frameName Does anyone have any advice how to deal with this? Link to comment Share on other sites More sharing options...
lloydevans Posted July 28, 2017 Share Posted July 28, 2017 You might want to consider offering more detailed information about both your implementation and the undesired behaviour you're experiencing. What devices/browsers are you running on? What are your Texture packing settings? What do you mean by updating the sprites? Maybe even a CodePen/JSFiddle demonstrating this? etc. I've never had any problems using PIXI.MovieClip with Texture Atlases. Link to comment Share on other sites More sharing options...
b0y2k Posted July 28, 2017 Author Share Posted July 28, 2017 Thanks for the reply lloydevans Unfortunately the assets are under licence and cannot be shared online at this time... It is actually a texture atlas so sorry for the confusion, i just call them sprite sheets out of habit i think. So a better run down of what is happening.. I am making a series of slot games so there are 5 colums with 3 icons in each. When you initiate the spin you move the columns up to the top and then tween them down. When they reach the bottom you move them back up to the top and repeat. As you move from the bottom to top position you update the sprites so it appears a seamless loop. It looks to me like the 'blink' is the whole image being added to the stage and then updating to the right frameName, causing it to flicker very briefly... The game is made for desktop and mobile and happens on both. All atlases are under 2mb and 2048x2048 or under. Link to comment Share on other sites More sharing options...
b0y2k Posted July 28, 2017 Author Share Posted July 28, 2017 Ok so on further testing, it seems to be an issue with desktop. (native and also in device sim mode) in chrome. Safari on ipad / phone seems to update fine. hmm Link to comment Share on other sites More sharing options...
lloydevans Posted July 28, 2017 Share Posted July 28, 2017 Hmm, interesting. Unfortunately I'm not very experienced with Phaser, I just know PixiJS quite well. Perhaps Phaser is unloading and loading textures? Maybe you just want to create all the textures from frames before hand and use references to those texture object instances. Link to comment Share on other sites More sharing options...
lloydevans Posted July 28, 2017 Share Posted July 28, 2017 In PIXI you can pass an array of texture objects to the PIXI.extras.MovieClip class. With that method you have control over where/when you create/dispose the textures. Link to comment Share on other sites More sharing options...
b0y2k Posted July 28, 2017 Author Share Posted July 28, 2017 Will give that a try thanks. Link to comment Share on other sites More sharing options...
lloydevans Posted July 28, 2017 Share Posted July 28, 2017 Pixi does hold all loaded textures in a texture cache too. I may be leading you down the wrong path as I don't know much about your code. This looks like it will be relevant: https://photonstorm.github.io/phaser-ce/Phaser.FrameData.html Link to comment Share on other sites More sharing options...
Recommended Posts