seekdopa.blogg.se

Texturepacker 1 row
Texturepacker 1 row













19 # Betting, for these pictures, we have to filter out, you can add Chinese to these pictures. ") + " \\Assets\\Resources\\UIAtlas " 5 def export_atlas(atlas_name, images_path):Ħ file_list = "" 7 for dir_name in os.listdir(images_path):Ĩ path_name = os.path.join(images_path, dir_name)ġ0 continue 11 12 # Judgment file type 13 file_ext = os.path.splitext(path_name).lower()ġ6 continue 17 18 # Some pictures may be abandoned, but the art does not want to delete, or the art is used to give the program. Our defined texture_packer.py file content is as follows:Ģ 3 IMAGE_EXT = Ĥ ATLAS_OUTPUT_PATH = os.path.abspath( ". Here we have to introduce such an automated packaging script, develop using Python. In the end, these small patterns will be packaged into an atlas, stored under the assets / resources / uiatlas folder: The small maps in each subfolder stored in the UIResources folder will eventually be packaged into an atlas, such as the Battle folder under UIResources, the small pictures in the Battle folder are as follows: For example, Art Variety resource is placed under the UIResources folder, with the assets: The game engine supported by TexturePacker is quite wide, mainly including Unity, Cocos2D, Spritekit, libgdx, etc., exported picture formats are also very rich, can be exported as PSD, PNG, TGA, JPG, etc., and can pass by command line use it.ĭuring the game development process, the art's small map resources do not need to be stored in the game engineering, because we will only use the package after the game engineering. There are many ways to pack atlas, which is introduced here to pack atlas with the TexturePacker tool. When using NGUI in Unity, in order to reduce the Draw Call, we will put the beautiful pictures of the art to a portrait, as shown:















Texturepacker 1 row