#How would I change a texture atlas at runtime?

3 messages · Page 1 of 1 (latest)

stiff hamlet
#

I currently have a player with a couple of states and I want to control what animation plays for what state. Unfortunately, all the animations are in separate files.

How would I go about changing the texture atlas for this,,,

The two images below showcase how i'm setting the animation and how i'm doing state checking for the player.

tepid imp
#

Honestly, it might be best to combine the separate animations into one big texture sheet. Otherwise you can either create a resource which stores handles to the texture sheets and use that to swap the texture sheet to the correct one when needed, though this seems somewhat worse than the single sheet solution