DragonBonesAS icon indicating copy to clipboard operation
DragonBonesAS copied to clipboard

Add support of TextureAtlas frames for trimmed textures

Open Adolio opened this issue 7 years ago • 2 comments

In order to fully support the "Trim mode" of TexturePacker, the code will require some further implementation in the Slot logic.

The "Trim" option helps to win precious surface on the texture atlases by removing transparent pixels. It would be a real plus to finish its support in DragonBonesAS.

Thanks in advance!


TODO references in the code: https://github.com/DragonBones/DragonBonesAS/blob/450d4d3013592cedd2803476e9134190b8d3e759/Starling/Starling_1.x/src/dragonBones/starling/StarlingTextureAtlasData.as#L26 https://github.com/DragonBones/DragonBonesAS/blob/450d4d3013592cedd2803476e9134190b8d3e759/Starling/Starling_2.x/src/dragonBones/starling/StarlingTextureAtlasData.as#L26

Adolio avatar Aug 16 '17 17:08 Adolio

Hi, There is no solution to fully support the starling texture atlas yet, subtexture will be dislocated regardless of whether the code is open or not, the best solution is to tirm images before the package in texturepacker, or use DragonBones Pro to manager texture atlases.

akdcl avatar Aug 17 '17 01:08 akdcl

I finally found the time give a try to implement this feature... and here it is: https://github.com/Adolio/DragonBonesAS/commit/aa8c3571fbb647bc576555ce12ce881761ab5f36

It seems to work pretty well for me (for both standard textures & meshes) 🙂

Adolio avatar Oct 11 '21 20:10 Adolio