插件下载地址:https://github.com/ufna/VaTexAtlas
使用方法:https://hiazma.atlassian.net/wiki/spaces/VTA/pages/1146888/How+to+use+VTA+plugin
How to use VTA plugin
Created by Vladimir Alyamkin
Last updated Aug 07, 2016
Related software
VaTexAtlas plugin is designed to work with sprite sheet data exported from TexturePacker (https://www.codeandweb.com/texturepacker) in JSON Array data format.
Project configuration
Data
It's important to use this configuration:
- Data Format: JSON (Array)
- Data File: same folder, with .vta extension (not .json!)
- Trim sprite names: true
If you leave .json extension it will be imported to Unreal as Paper2D spritesheet.
Texture
Use default configuration for most cases - it's best choice for UI.
Check Tips and Tricks to read about optimization for opaque atlases (f.e. banners, big icons, etc.)
Layout
Use provided settings if you're making a game for mobile devices. It's right choice to have squared POT textures for them.
For desktop projects you can disable "Force squared" option.
Also, Scale option can be useful for different item icons, etc., where pixel-perfect resolution isn't necessary.
Export from TexturePacker
Just setup your project and then click "Publish sprite sheet"
Import to Unreal Engine 4
Select the *.vta file created with publish operation and import it to the engine the same way you're doing it for any other asset.
After that you'll find one asset and two folders created:
Texture Atlas asset is the "manager" of your texture atlas. If you made any changes to it with TexturePacker, you should reimport exactly this guy.
Textures folder contains the atlas itself, which is a texture that used for frames.
In Frames folder you'll find bunch of Material Instances - all of them are using the same texture, but cropped to show only desired icon.
UMG usage
You can easily use frames instead of Texture2D for your UI.
Good luck and have fun!
Plugin Installation
Created by Vladimir Alyamkin
Aug 07, 2016
Installation notes
If you want to build the plugin from source code, and have no experience about it, please check the official Plugins documentation or An Introduction to UE4 Plugins wiki article.
Anyway, VaTexAtlas is editor-only plugin, so you can just follow few steps below.
Install binaries
- Download the plugin source for the latest release
- Copy archive content to YOUR_PROJECT/Plugins/VaTexAtlasPlugin directory
- Rebuild your project
Enjoy the plugin
That's all, you've got the power. Now you can use the VaTexAtlas in your project!
Texture Atlas Example
Created by Vladimir Alyamkin
Last updated Aug 07, 2016
You can download the example here: HUD_Atlas.7z
Contents
Inside you'll find complete set of assets to test VaTexPlugin usage in your own project:
- Few icons and HUD elements sliced into pieces (*.png)
- TexturePacker project (HUD_Atlas.tps)
- Exported data:
- HUD_Atlas.vta - texture atlass asset to be imported to UE4
- HUD_Atlas.png
Here it is:
How to use
Extract the archive content to any folder you want and then import HUD_Atlas.vta file into the engine.