Why does LoadSpriteAtlas only work with uncompiled png's?
See original GitHub issueNezContentManager.LoadSpriteAtlas
expects a texture adjacent to the sprite atlas, and it must be a png. Why doesnt it use the content manager for this and just get the texture with the same asset name? The justification for this isnt immediately obvious to me.
I’ve accomplished this in a hacky and naive way, but it works: https://github.com/dresswithpockets/Nez/blob/master/Nez.Portable/Assets/NezContentManager.cs#L176
public SpriteAtlas LoadSpriteAtlas(string name, bool premultiplyAlpha = false)
{
// ...
var atlasData = SpriteAtlasLoader.ParseSpriteAtlasData($"Content/{name}.atlas");
var atlas = atlasData.AsSpriteAtlas(ReadAsset<Texture2D>(name, null));
// ...
return atlas;
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
To each their own. After having written a dozen or so processors using the XNA API and maintaining them for 5+ years it was a massive relief to fall back to a makefile and just load my data without going through
Content
class at all.@dresswithpockets if you really want to use the old pipeline loaders, you can grab them from the commit history, they’ll in all likelihood continue to work just fine. I was using them in my fork of Nez recently with no issues.