![]() ![]() setting your packing tag to “UI_Elements” will force rect packing). If “” is specified in the Packing Tag, rectangle packing will be done (i.e. TightPackerPolicy will use tight packing by default if Sprite have tight meshes.setting your packing tag to “Character” will allow tight packing). DefaultPackerPolicy will use rectangle packing by default unless “” is specified in the Packing Tag (i.e.Sprites with the same texture compression settings will be grouped into the same atlas where possible. Atlases are then further sorted by the texture import settings so that they match whatever the user sets for the source textures. With these policies, the Packing Tag property in the Texture Importer directly selects the name of the atlas where the sprite will be packed and so all sprites with the same packing tag will be packed in the same atlas. It is possible to create your own packing policies (see below) but the Default Packer Policy, Tight Packer Policy and Tight Rotate Enabled Sprite Packer Policy options are always available. The Sprite Packer uses a packing policy to decide how to assign sprites into atlases. At the right of the toolbar are two controls to zoom the view and to switch between color and alpha display for the atlas. The menu next to the page number selects which “packing policy” is used for the atlas (see below). The View Atlas and Page # menus allow you to choose which page of which atlas is shown in the window (a single atlas may be split into more than one “page” if there is not enough space for all sprites in the maximum texture size). (A related Repack button will appear when you implement a custom packing policy as explained in Customizing the Sprite Packer below). The Pack buttons initiates the packing operation but will not force any update if the atlas hasn’t changed since it was last packed. The toolbar at the top of the Sprite Packer window has a number of controls that affect packing and viewing. The outline is actually the render mesh outline and it also defines the area used for tight packing. If you select a sprite in the Project panel, this will also be highlighted to show its position in the atlas. ![]() If you open the Sprite Packer window (menu: Window -> Sprite Packer) and click the Pack button in the top-left corner, you will see the arrangement of the textures packed within the atlas. packing is enabled for both Play mode and builds). packing is used for builds but not Play mode) or Always Enabled (i.e. The sprite packing mode can be changed from Disabled to Enabled for Builds (i.e. The Sprite Packer is disabled by default but you can configure it from the Editor settings (menu: Edit -> Project Settings -> Editor). Users are required to specify a Packing Tag in the Texture Importer to enable packing for Sprites of that Texture. The atlas can optionally be packed on entering Play mode or during a build and the graphics for a sprite object will be obtained from the atlas once it is generated. Unity handles the generation and use of sprite atlas textures behind the scenes so that the user needs to do no manual assignment. Unity provides a Sprite Packer utility to automate the process of generating atlases from the individual sprite textures. For optimal performance, it is best to pack graphics from several sprite textures tightly together within a single texture known as an atlas. However, a significant portion of a sprite texture will often be taken up by the empty space between the graphic elements and this space will result in wasted video memory at runtime. When designing sprite graphics, it is convenient to work with a separate texture file for each character. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |