Changing Spine atlas at runtime

A question from a user required them to change the atlas at runtime to add an offset.

The Spine component has a atlasAsset property that can be given an assetId and will rebuild the spine object to use the new atlas.

    this.entity.spine.atlasAsset = this.newAtlasAsset.id;
    this.entity.spine.state.setAnimation(0, "portal", true);

There’s also atlasData that can be used if a JSON object is being created and dynamically changed at runtime.

2 Likes