0 votes

For the roguelike I'm developing I wish to add a gradient-like feel to the field of view of the character. To do so I decided to add a TileSet on top of the ground so that each tile would have a diferent alpha value depending on the distance to the player. It would be the same tile, just different alpha value.

However, I cant seem to find a way to modify a tile before or after placing it via code or otherwise. Is it even possible? If it's not, how could I go about my problem?

Thanks for any help!

asked Feb 3, 2019 in Engine by Solanich (23 points)

2 Answers

+1 vote
Best answer

I don't know how to solve the alpha problem in the tile but if i deal with that problem what i would do is create in the tileset have different version of the same tile and change in code between them.

like this (3 different version of the same tile) 3 different version of the same tile

and if i need multiple alphas and don't want to do multiple sets for every one maybe i create like 3 tilemaps, change alpha tile maps, and load the tileset in the map wiht more alpha if you are closer. And load in the tilemap with less alpha if you are far.

example

I don't know if this have sense in your game. ._. In the image i have 3 tilemaps with different alpha, i use the tilemap with more alpha for the tiles are closer, tilemap "2" in the middle distance and "3" far distance

answered Feb 3, 2019 by crossbit (71 points)
selected Feb 5, 2019 by Solanich

I thought of this but hoped there would be a more elegant solution to the problem.
Thank you! :)

0 votes

Is this still up to date?
I place 2d walls ingame via tileset and when I’m still dragging the size i want to let it blink, to show that the wall isn’t placed jet
I would prefer doing it via alpha

answered Sep 19, 2019 by gruen (63 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.