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

I want to be able to select specific tiles to be rendered with transparency information (opacity) #895

Open
Mephisztoe opened this issue Jun 17, 2024 · 0 comments
Assignees

Comments

@Mephisztoe
Copy link

Right now, I can set a specific layers' opacity property to a value of my choice.
This makes the TiledMapRenderer set the respectives layers' TiledMapEffect.Alpha property accordingly and thus renders a complete layer transparent.

If possible, I would like to be able to make only specific tiles transparent.

The idea is, that when a sprite controlled by a player hides behind a wall for example, I would like to be able to make a specific region transparent. Right now, I am basically rendering two different layers - one background and one foreground layer and the sprite in between. This way, the sprite can hide only behind the tiles that are defined on the foreground layer.

I would then identify if the sprite overlaps with one of these tiles and then think about a maximum range of tiles that are connected to the one that hides the player so that they can be rendered transparent while the player moves.

Here is an example:

image

I would also like to be able to tween the alpha value between values over time.
So for instance, the alpha value is always like 1.0f and the moment the player enters an area where he hides behind a wall for instance, the alpha value gradually tweens down to .5f within a second.

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

No branches or pull requests

2 participants