Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Delete tile SFML + TinyXML  (Read 1497 times)

0 Members and 1 Guest are viewing this topic.

Dark254

  • Newbie
  • *
  • Posts: 3
    • View Profile
Delete tile SFML + TinyXML
« 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?
« Last Edit: October 09, 2020, 09:36:37 am by Dark254 »

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: Delete tile SFML + TinyXML
« Reply #1 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.
Visit my game site (and hopefully help funding it? )
Website | IndieDB