Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TileSets do not support tilesets which do have one image per tile #754

Open
LokiMidgard opened this issue Jan 19, 2022 · 0 comments
Open
Milestone

Comments

@LokiMidgard
Copy link
Contributor

LokiMidgard commented Jan 19, 2022

In case you load an tileset that has one image per tile and tileset has no texture set, a Nullreference exception is thrown and the build fails.

This fails since it Image in tileset is null

tileset.Image.Source = Path.Combine(Path.GetDirectoryName(filePath), tileset.Image.Source);

There are more problems later on:

// Build the Texture2D asset and load it as it will be saved as part of this tileset file.
//var externalReference = new ExternalReference<Texture2DContent>(tileset.Image.Source);
var parameters = new OpaqueDataDictionary
{
{ "ColorKeyColor", tileset.Image.TransparentColor },
{ "ColorKeyEnabled", true }
};
//tileset.Image.ContentRef = context.BuildAsset<Texture2DContent, Texture2DContent>(externalReference, "", parameters, "", "");
contentItem.BuildExternalReference<Texture2DContent>(context, tileset.Image.Source, parameters);

var externalReference = externalReferenceRepository.GetExternalReference<Texture2DContent>(tileset.Image.Source);

Should the importer or processor stitch the images together?

Adding each tile an image seems not the best aproach looking at the renderer...

@AristurtleDev AristurtleDev added this to the v4.0.0 milestone May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants