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

feat: Adding way to configure a layer paint in flame tiled #2851

Merged
merged 5 commits into from
Nov 14, 2023

Conversation

erickzanardo
Copy link
Member

@erickzanardo erickzanardo commented Nov 14, 2023

Description

Creates a configuration in Flame Tiled that allows developers to use custom paint objects which can be useful when we need to render tilesets that require a different Paint configuration other than the default one. Like low rez pixel art tilesets which benefits from using filterQuality.none

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Replace or remove this text.

@erickzanardo erickzanardo changed the title feat: adding way to configure a layer paint in flame tiled feat: Adding way to configure a layer paint in flame tiled Nov 14, 2023
@erickzanardo erickzanardo requested a review from a team November 14, 2023 20:10
Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does things a bit differently than what we do everywhere else where we pass along a Paint object. Meanwhile this looks quite handy, shouldn't we first and foremost go for consistency?

I also don't understand fully, why is only the opacity an input to the factory function?

@erickzanardo
Copy link
Member Author

This does things a bit differently than what we do everywhere else where we pass along a Paint object. Meanwhile this looks quite handy, shouldn't we first and foremost go for consistency?

I also don't understand fully, why is only the opacity an input to the factory function?

Yeah, so, from what I understood from Flame Tiled code (I am still getting used to all of its structure haha). There is one paint per layer. That paint should contain the opacity of such layer, hence why the factory receives the opacity, so the paint can be built taking that into consideration. I am not sure how we could do if TiledComponent received the paint object directly instead, because that object would already arrive built to the layer and it would be built without the layer opacity.

Usually I would be more for the consistency, but in this case I don't see how we could accommodate by passing the objects.

@spydon
Copy link
Member

spydon commented Nov 14, 2023

Yeah, so, from what I understood from Flame Tiled code (I am still getting used to all of its structure haha). There is one paint per layer. That paint should contain the opacity of such layer, hence why the factory receives the opacity, so the paint can be built taking that into consideration. I am not sure how we could do if TiledComponent received the paint object directly instead, because that object would already arrive built to the layer and it would be built without the layer opacity.

Usually I would be more for the consistency, but in this case I don't see how we could accommodate by passing the objects.

It should be possible to pass down a factory function through the FlameTileLayer, exactly the same path as the filterQuality goes today I think? Going down the route of having these disconnected singletons is a bit dangerous I think.

@erickzanardo
Copy link
Member Author

Ah, alright, I thought you mentioned passing down the instantiated objects, not the factory itself. That we can do!!!!

@erickzanardo erickzanardo merged commit e893d11 into main Nov 14, 2023
9 checks passed
@erickzanardo erickzanardo deleted the feat/tiled-configurable-paint branch November 14, 2023 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants