Try using TrueColour or Automatic TrueColour option in the inspector, which will maintain the image quality. To get rid of it just set this value to 0 and use the actual size of the image frames in your code. 1 You are using the DXT1 compression settings after you changed it to a texture. ('Circle', 'assets/animations/CircleKill.png', ) ĮDIT: I just figured that the 1-pixel extra all around is due to the option Extrude in the “Sprites” tab of TexturePacker that comes configured to 1 by default and that can cause a lot of confusion (as it caused to me). Since I don’t have a public host server to publish everything, I made this small video to show what happens. All frames have 57 x 51 pixels.Īlso below you will see my code: class Level1 extends Phaser.Scene The problem is that when I preview it in TexturePacker it apparently works fine but when I play it in Phaser it shows an unexpected behavior (the whole animation rolls up as an old TV with vertical issue). I added a copy of the sprite generated by TexturePacker (CircleKill.png). The first scene is how it previews in TexturePacker (correctly), then in the next scene I show what it’s doing in Phaser and then I show the TexturePacker screen. The problem is that when I preview it in TexturePacker it apparently works fine but when I play it in Phaser it shows an unexpected behavior (the whole animation rolls up as an old TV with vertical issue). That said, this is largely just a matter of looks and if think a bone style animation would work just as well, don't arbitrarily exclude it.I am having a weird experience with TexturePacker (I am using registered version). Bone animations are fine though, they just aren't usually a pixelart thing. Im assuming here that your sprites pivot is its center, placed at (0, 0, depth) in the cameras coordinate system, and that the aspect ratio of the sprite is known to be as wide or wider than the widest supported resolution so it fills the frame. Bone animations are kinda the half way point between 3D animation and 2D animation and thus not really a pixelart ascetic. If you cannot use an Image (for nay valid reasons), you can get the width and height of the texture: width rawImage.height width aspectRatio This should make the rect of the image of the appropriate ratio of. Default: Fit to width Fit to height Keep original size (Press enter to. In pixelart, usually they'll use actual sprite sheets, not the bone animations. First convert the image into sprite in unity editor, then you can load that at. The options are available from command line and from the graphical. You don't need all your sprites to be this same number of pixels, but they should all be using the same pixel per unit (so for instance, you could have a tree that is 32圆4 or something).Ģ. This chapter describes the options used for packing your sprite sheets. If you're using a tilemap, for instance, it will generally match the vertical pixel size of your tile sprites and you'd want 20 of those tiles to fix vertically on your screen at your desired resolution. The way it works is the vertical resolution is 20 units, so you want your sprites to neatly use up that resolution. This increases the performance of your game: You can easily manage your sprite sheets. Where spriteBatch is the SpriteBatch and frame is a Sprite x, y, width and height are the same as you would use in spriteBatch.draw(frame, x, y, width, height) To only draw the top half of a sprite (as if the sprite was standing in a liquid, for example) you would set the height, the texture region height, and include a slight adjustment to. the character above is a 32x32 sprite For a size reference, the character above is a 32x32 sprite. Whatever you choose, though, ensure you pixels per unit setting allows your expected resolution to make the most of your sprites. TexturePacker gives you some advantages over the SpritePacker: You have 70 fewer vertices and 30 less overdraw compared to Unity’s packing. Whenever Unity makes a new sprite, it uses a texture. how big your sprites should be is purely up to what you feel is good for your game. Haven't got much a nose for ascetics, but I can give my opinion:ġ.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |