What is Atlas Editor
Atlas Editor is a tool use for pack sprites to a big atlas texture in EasyMotion2D.
Why use atlas
-
Drawcall batch
-
In Unity3D if objects have the same material and material's parameters member are the same, they will can be rendering in one drawcall. It's a very important optimization for mobile device.
-
-
RenderModeSetting
-
In EasyMotion2D it use RenderModeSetting asset to decide how the sprite will rendering. EasyMotion2D will group sprites by RenderModeSetting and texture and sprite's depth in scene.
-
If sprites in a depth range and they use the same RenderModeSetting and same texture, then these sprite can rendering in one drawcall.
-
For example:
-
-
So that is why we need use atlas editor, because we need pack each small texture into a big texture to make sprites rendering batch friendlly.
How to use
Four step to create a atlas
-
Open or Create a atlas asset in project.
-
Click the “Create Atlas” button in left-top of Atlas Editor window will create a Atlas Asset file in Project Window. The Asset file's path is same as current selection in Project Window. If current has no selection in project window, path will be asset folder's path.
-
Click the object field you can selected a exist atlas in project, and open it to edit.
-
-
Drag and drop sprites from Sprite Asset Viewer to atlas editor you want pack.
-
-
You can click “Layout” button to layout sprites automatically.
-
You can also drag sprite to layout manually.
-
-
-
Click “Build” button can be pack all sprite into a atlas texture.
-
The Layout option panel
-
Texture
-
If atlas already have a atlas texture, it will display in this field.
-
-
Width & Height
-
The atlas texture's width and height.
-
-
Texture Size
-
The atlas texture size you will want pack into.
-
-
Enable Resize Toggle
-
If check this, layout operation will auto adjust texture size to pack all sprites.
-
If not, will use the Texture Size as atlas texture size to pack all sprite into, if can not pack all sprite into the texture with Texture Size, will ouccr an error.
-
-
Set Width/Height same Toggle
-
If check this, will make texture's width and height are same, even pack all sprite do not need the size of texture.
-
-
Sort By
-
Sorting the sprites by what.
-
Layout will sorting all the sprites you want pack, and find space to layout they one by one.
-
-
Sort Order
-
Sorting sprites order.
-
-
Padding
-
The padding of sprites between each other.
-