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

How to scale a character? #192

Open
boehm-e opened this issue Oct 25, 2018 · 2 comments
Open

How to scale a character? #192

boehm-e opened this issue Oct 25, 2018 · 2 comments

Comments

@boehm-e
Copy link

boehm-e commented Oct 25, 2018

Hi :)

I am using the helloDragonBones example, and trying to scale down my character: so i do like that :

factory.loadTextureAtlasData("data/sheep/Sheep_Ani_tex.json", &texture, "",0.5f);

but i got strange results : only one part of the character is scaled, and the armature does not seems to be scaled.
So is there a way i haven't seen, for scaling characters ?

Thank you,

image

@Hary309
Copy link
Member

Hary309 commented Oct 25, 2018

You have to scale armature in draw function using sf::RenderStates.
Example:

sf::RenderStates states;
states.transform.scale(0.5f, 0.5f);
window.draw(*armatureDisplay, states);

@boehm-e
Copy link
Author

boehm-e commented Oct 25, 2018

👍

Thank you,
I have found another way, which does not involve sfml:

	armatureDisplay->getArmature()->getBone("root")->offset.scaleX = 0.5f;
	armatureDisplay->getArmature()->getBone("root")->offset.scaleY = 0.5f;

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