Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling multi-resolution textures with addTextureAtlasData #87

Open
loksland opened this issue Oct 27, 2016 · 3 comments
Open

Handling multi-resolution textures with addTextureAtlasData #87

loksland opened this issue Oct 27, 2016 · 3 comments

Comments

@loksland
Copy link

loksland commented Oct 27, 2016

I am using addTextureAtlasData to load texture atlases from the Starling assetManager:

factory.addTextureAtlasData(StarlingTextureAtlasData.fromTextureAtlas(assets.getTextureAtlas('anim')), 'anim');

The scale of the textures that are rendered is not right as the textures are a different scale to those used to configure the DragonBones project. This is because I need to support multiple-resolutions.

What is the best way to implement asset scaling through this call?

factory.scaleForTexture seems to have no effect and I don't want to use the factory.parseTextureAtlasData method in this situation.

@akdcl
Copy link
Member

akdcl commented Oct 27, 2016

Hi,
You can have a look about this demo in dev branch.
https://github.com/DragonBones/DragonBonesAS/blob/dev/Starling/Demos/src/MultiResolutionTextureAtlas.as

@loksland
Copy link
Author

Thanks @akdcl, in the provided demo the scale factor param has been added to the parseTextureAtlasData method in dev branch, though in my situation I am using addTextureAtlasData. Is there an equivalent way to set the scale for this method?

@akdcl
Copy link
Member

akdcl commented Oct 27, 2016

StarlingTextureAtlasData.fromTextureAtlas will set the scale from starling, may be the scale is not suitable for the armature scale.
You can scale dragonBoneData when you parse it.
You can also look at this issue, #86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants