Unity-Technologies/2d-extras

New transform of rule tile: rotate and mirror

samgong opened this issue · 6 comments

I have a rule tile mixing grass and dirt on ground:
Snipaste_2022-11-25_02-45-18

3
4 ? 5
5

It works well by choosing MirrorX for horizontal grass.

However vertically, the following form does not match by choosing Rotate or MirrorXY.

4
3 ? 5
5

I know well that I could manually create a new tile sprite by flipping it and set up both rules with rotation transform to accomplish it.
But it would be better to have a new transform for "rotate and mirror" to get it done with one rule and one tile sprite.

Hi, I tried adding this new transform rule in:
https://github.com/Unity-Technologies/2d-extras/tree/rotatedmirror

If you can, could you try it out and see if that is what you are looking for? Thanks!

For the horizontal grass that mirrored, it does not match the new rule and the default sprite is shown.
original: OK
10
mirrored: not working
11

For the vertical grass, the new rule matches both cases but the sprite itself need an additional mirror transform.
13
14

Hi, perhaps I don't quite understand how the Transform Rule should work for you. If you could share how your Rules work and how they look like in the inspector, that would be helpful! Thanks!

grid

The goal is to create tile 1 to 8 with rule tile. Let tile 1 be the base tile sprite, the rotation rule will generate tile 1, 3, 5, 7. the mirrorX rule will only generate tile 1 and 2. To generate all 8 tiles, currently I have to use 2 base tile, tile 1 + rotation rule to generate tile 1, 3, 5, 7 and tile 2 + rotation to generate tile 2, 4, 6, 8. Now "rotate and mirror" is a rule to generate all 8 tiles at once from tile 1.

image

Sorry for the late reply! I updated the rotatedmirror branch based on the example you have given. Hopefully that matches what you need!

Thank you. It is exactly what I need!