Secrets of custom export. Part 2
Hi everyone! Hope your week was as good as mine.
Today post is second one from the series about export. Who needs atlas custom export, I would recommend to read our previous post, in order to understand the whole process.
We have already discussed what these magic export and write functions are, what they do and where are implemented. The only unrevealed thing is arguments of export function. So, let's dive in.
Export function accepts 2 arguments: atlasImages and atlas.
Atlas is an object that contains all general information. It is:
-atlas image name;
-scale;
-texture pixel format, default value is RGBA8888;
For now, this is all general data we give access to. Probably, it is not the last iteration and it will be expanded, but this minimum is enough for game engine to work with atlas.
AtlasImages - another function argument. It's a little bit more complicated than previous one. It is an array of objects that contains detailed information about every image.
-name - identifier by which lately you find'll a texture to create a sprite - "load.png" for e.g. Image name can be trimmed. It means file extension is cut and we have "load" instead of "load.png".
-isTrimmed - is a boolean value that shows whether image in atlas has preserved its original size or transparent pixels were cut.
-x, y - position of image in generated atlas.
-w,h - size of image in generated atlas.
-srcW, srcH - original size of the image we added to packer.
-cropX, cropY, cropW, cropH - position and size of trimmed image within the origin. If image was not trimmed cropX / cropY are 0 and cropW/cropH equal srcW/srcH.
This data also can be expended due to more features in GAP like pivot/anchor changing possibility or other packing algorithm than can rotate images for atlas size optimization or desirable hit area. But all this will be possible, if you need GAP.
Hope this post and previous one show you that there is no special magic in custom export and it 's easy deal. If you have any suggestions and comments, do not hesitate to write below.
Thanks.
Files
Get GAP : Generic Atlas Packer
GAP : Generic Atlas Packer
gap
Status | In development |
Category | Tool |
Author | _enot |
Tags | atlas, Automation, gap, image, packer, Textures |
More posts
- GAP Update: Progress And First Community Feedback!Aug 05, 2024
- GAP: v0.2.3Jul 29, 2024
- GAP Update: Drag and Drop Your Assets!May 27, 2024
- GAP Update: Faster and Smaller Packing!May 20, 2024
- Secrets of custom export. Part 1May 06, 2024
- GAP: v0.1.7 - #8Apr 26, 2024
- GAP: v0.1.6 - #7Apr 22, 2024
- GAP: v0.1.5 - #6Apr 15, 2024
- GAP: v0.1.4 - #5Apr 08, 2024
Leave a comment
Log in with itch.io to leave a comment.