#Texturepacker bad frames code#
Would it be preferable to pad the images with blank pixels up to the nearest power of two and if so, how would I then cut out the padding so it isn’t rendered? Is there a way to fix this problem without having to modify the code in addition to the assets?įor context as to why I’ve concluded that this is the situation on the raspberry pi: However, I’m wondering if there isn’t a better or simpler way to deal with this problem. Apply that scaling in code in Phaser to fix the sprite.Compute a scaling factor for each dimension that will fix the inevitably broken aspect ratio.Round up (possibly down) to the nearest power of two independently in each dimension.I’ve never had to take content that was already created and switch it to be a power of two. Now, I’m an old school OpenGL programmer, I remember the non-power-of-two days vividly and they weren’t THAT bad, but we always just planned ahead. The WebGL implementation for the RPI does not support the non-power-of-two extension. The biggest problem seems to be the lack of support for certain kinds of textures and in particular, non-power-of-two textures. So my games need to support WebGL 1 (aka OpenGL ES 2.0). The canvas renderer, for various reasons, causes artifacts or just throws exceptions for a few of the games and that, combined with the fact that it is significantly slower than the WebGL approach, has led me to not prefer this option (at least not yet). I am exploring running Phaser 3 games on a raspberry PI 3B+ and have run into a very unexpected problem: either I must run the game with the Canvas renderer or I have to make the game compatible with WebGL 1 (why is explained at the bottom of this post).