StringKiller

I have backed spine on kickstarter so I still don't have a license to check how does spine projects actually work on libgdx but I'm currently working on some stuff for a game. I have an important question so I won't have future problems with my desings:

Is it possible to scale a spine animation as a whole once you are using libgdx + openGL? not scaling the bones as spine does since that can certainly distort and displace your images, just doing a simple scaling to the whole thing as if they were independent frames.

Thanks in advance.
StringKiller

Kickstarter Backer
  • Сообщения: 84

Magnesus

Yes, no problem. Sample code:
root.setScaleX(0.4f);
root.setScaleY(0.4f);
skeleton.updateWorldTransform();
skeleton.draw(batch);
Magnesus

Kickstarter Backer
  • Сообщения: 111

Nate

You can scale the root bone, as Magnesus has shown. If you scale both the X and Y the same, there will be no distortion.

You can also scale the Camera or SpriteBatch you are using to draw.

You can also scale the skeleton and animations at load time using setScale on the loader. This will let you use larger or smaller images than were used in Spine, or will just scale the images.
Аватара пользователя
Nate

Nate
  • Сообщения: 9264


Вернуться в Editor