Tiles with sprite.flip_h=true in don't appear flipped when using TileMap

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

Hi all,

I have a TileSet in which some of the tiles also have a Sprite.flip_h=true version. I created this TileSet by creating a scene with a Sprite/StaticBody2D/CollisionShape2D for each tile, and then converting the whole scene to a TileSet (I don’t know if this matters).

For each tile that should have two versions, I duplicated it and changed the Sprite.flip_h of one of them. In the Scene (later converted to a TileSet) everything appears as I’d like.

In a different scene, I added a TileMap and load the TileSet. The Sprites that should be flipped (those with Sprite.flip_h = true in the TileSet) don’t show flipped (ie. they appear as if Sprite.flip_h=false)!

Any idea of what I may be doing wrong?

Thanks!

:bust_in_silhouette: Reply From: kidscancode

That’s because TileMaps don’t use Sprites. They use TileSet resources which contain data - textures and polygons - and that’s it.

The fact that you can use Sprites to create a scene that is then converted to a TileSet doesn’t mean that the TileSet is going to have Sprite properties.

There is a button in the TileMap UI to flip a tile, or you can use the flip_x parameter of set_cell().