It seems like you're on the right track with using setRawDataURI
to load your assets into the AssetManager
for the spine-webgl runtime. The method you've mentioned, setRawDataURI
, is indeed designed to handle various types of assets, including JSON, binary, atlas, and PNG images, by setting them directly using base64 encoded data URIs.
Given the error message you're encountering, it's possible that the issue lies not with how you're loading the atlas file into the AssetManager
, but rather with how or when you're attempting to access it. Ensure that the asset name you use with assetManager.require("atlas.atlas")
exactly matches the name you used when setting the raw data URI. Additionally, it's crucial to make sure that the asset has been fully loaded into the AssetManager
before attempting to access it. The AssetManager
in spine-webgl is asynchronous, meaning assets might not be immediately available after calling setRawDataURI
.
Here's a checklist to troubleshoot your issue:
- Verify that the base64 string (
atl
) for your atlas file is correctly encoded and complete.
- Ensure that the asset name
"atlas.atlas"
used in both setRawDataURI
and assetManager.require
matches exactly, including case sensitivity.
- Confirm that the asset has been fully loaded by the
AssetManager
before attempting to access it. You might need to use callbacks or check the loading state of the AssetManager
to ensure assets are ready before use.
If you've followed these steps and are still encountering issues, it might be helpful to review the full asset loading process in your application to ensure that assets are being loaded and accessed in the correct order and that the AssetManager
has had sufficient time to load the assets before they are required.