I think I might implement a pre-deployment routine at one point, that will turn the map into one image, that would solve the problem once and for all - and maybe a similar routine that will space out sprites manually tooīut at the time, during development, I guess patching and deferring the issue is the way to go (Although I check the type/CONST and verify the WebGL/Canvas usage, it's almost unbelievable how the two pictures are exactly the same in both Renderers, it's admirable how consistent PIXI is) Up to this point, I didn't really think about WebGL/Canvas, PIXI was an isolating layer as it was supposed to be (and it is : ), now I implemented a routine to see what I was using, it was WebGL, tried Canvas too roughly, luckily my manually patched dynamics works the same on Canvas too - so switching to Canvas didn't change things as I was afraid they might Obviously this is not applicable for the map, the map itself needs to have integer coordinates, as tiles need to be exact, however, the monsters on the map can have float coordinates if I shrink them by 1px from the edges (These are when I test these properties individually, one by one, the above pictures are the comparison for your suggestion)ĭirty solution: Use float + manually shrink sprites by 1px, so if sprites overflow by 1px, they render what they should have rendered in the first place Int/float: using float triggers the issue from frame to frame even with NEAREST LINEAR/NEAREST - There's something definitely wrong if I use LINEAR, the problem I described tenfolds My experience, antialias: true/false makes no visible or observable difference, I even suspect it's always on, I check the drawn stuff with a loupe and can't detect any changeĢx entities / 2x map / 2x stage(?), doesn't make a difference, no matter where the scale comes from, they are rendered the same, same issues Here is antialias, 2x scaled map, LINEAR, antialias: true, float I considered lot of times to rewrite it, but unfotunately I currently have no time for it.Here is no antialias, 2x scaled map, NEAREST, antialias: false, int I do not update it anymore (only if I really need it). Piece of "JSON - TP+Properties" export: ,Īs said before. (this one is old, lot of new export options were added) Here are two tutorials for old version, but most of it is still valid: xml - I created this when importing into Unity and creating prefabs automatically, or there are some animation features from my old mobile games exported into binary export) there are also other features, but these may work only under special circumstances (for example there is export of atlas metadata into. Second is with additional properties (anchor + custom), there are multiple export options - for Phaser are relevant two: "JSON - Texture Packer" and "JSON TP+Properties". you can set scale for individual sprites and for whole atlas (= you can easily rescale graphics and reexport atlas), you can add additional custom properties (number, point, rectangle) to sprites in atlas, You can drag them to change it - for Phaser I am exporting additional property "anchor" along with every frame (I wrote tutorial on it here: ), all sprites are imported with anchor 0.5, 0.5 by default. you can import individual images or images drawn in grid (they are cut from it) (there are some rules for the grid), xml file with some parameters and pathes to individual images (you can change them later in drawing program, and just reexport atlas), I made it long time ago and code inside is real mess.But I am using it for all my games (from Android/iOS to HTML5:Īlso the name is mess as it originally named PicOpt and then I renamed it to Spritor.
0 Comments
Leave a Reply. |