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

Docs for IsometricTileMapComponent example shows something inexistent #3163

Closed
1 task done
immadisairaj opened this issue May 18, 2024 · 1 comment · Fixed by #3165
Closed
1 task done

Docs for IsometricTileMapComponent example shows something inexistent #3163

immadisairaj opened this issue May 18, 2024 · 1 comment · Fixed by #3165
Assignees

Comments

@immadisairaj
Copy link
Contributor

immadisairaj commented May 18, 2024

What could be improved

I was just casually going through the component to try it out for the first time. Then I stumbled upon this below screenshot.
Screenshot 2024-05-18 at 20 54 05

Where there is IsometricTileset where I am confused as I don't see that method or class anywhere.

Until I saw the example code, I didn't know how to proceed further. Maybe this minimal example code could be updated to show proper working code. This kind of things might be there for other components as well? (not sure). But, as I came across this one, found it to be a problem.

Why should this be improved

When trying out something with new components, the first place would be docs and when this kind of issue comes, people might back out or have to go into example to look why they are facing the error.

Risks

No response

More information

Line in code:

final tileset = IsometricTileset(tilesetImage, 32);

Proposed solution:
Changing it to SpriteSheet?

// Creates a tileset, the block ids are automatically assigned sequentially
// starting at 0, from left to right and then top to bottom.
final tilesetImage = await images.load('tileset.png');
final tileset = SpriteSheet(image: tilesetImage, srcSize: Vector2.all(32));
// Each element is a block id, -1 means nothing
final matrix = [[0, 1, 0], [1, 0, 0], [1, 1, 1]];
add(IsometricTileMapComponent(tileset, matrix));

Other

  • Are you interested in working on a PR for this?
@ufrshubham
Copy link
Collaborator

@immadisairaj nice catch 🙂. I've assigned this to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants