How to modify a specific Tile (Sprite) variable within a TileSet

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Solanich

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!

:bust_in_silhouette: Reply From: crossbit

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)

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.

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

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

Solanich | 2019-02-04 03:34

:bust_in_silhouette: Reply From: gruen

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