SFML community forums

Help => Graphics => Topic started by: Dark254 on October 09, 2020, 08:44:01 am

Title: Delete tile SFML + TinyXML
Post by: Dark254 on October 09, 2020, 08:44:01 am
Hello everyone!

There is a problem: I'm using SFML with Tiled Map Editor and TinyXML. It works fine for me but I don't know how to delete a tile, or make it transparent. For example: if i clicked on apple tile, it dissapears from the map.
I understood that i need to work with layers, but i don't know how.

Can you help me with this problem please?
Title: Re: Delete tile SFML + TinyXML
Post by: Stauricus on October 09, 2020, 01:38:30 pm
i have no idea how you are creating your tiles (you should post a minimal example), but if you just want to make it transparent, the general idea would be to set tile_sprite.setColor(sf::Color::Transparent); if our tiles are based on sprites, or select each vertex of the specified tile and set vertex.color = sf::Color::Transparent if your tilemap is based on vertexarrays.