Flipping x or y axis of whole map scene

Godot Version

4.3

I have an idea for a mechanic and don’t really see if it’s possible to achieve with code. That would be much easier than drawing all versions of maps by hand.

Because all nodes of a scene have an x and y value assigned to them I’m wondering whether there is a way to flip and redraw all of the sprite nodes, together with the tilemap on opposite axis values in the world scene - as in [if this statement is true reasign placed object values where x = -x and y = -y].

The game world is 2d of course which - at least in theory - should make it work.

Thank you in advance.

1 Like

Shooting off the hip here:

Write a script and attach it to the root node.

The script iterates over all children.

For each child, grandchild etc…check the node type and perform flipping logic for that type.

Inevitably, there will be exceptions.

For exceptions give them a script with a custom flip logic maybe call it flip_logic

When iterating, first check if it has a flip_logic method, if it does run that, if it doesnt perform the generic logic.

1 Like

Sounds reasonable, thank you. I’ll check if that works.

1 Like

What if you made a full screen shader that flipped the whole screen image, then just flipped controls?

You’d just need a way to prevent text from flipping.

This one seems easier, tho I’d need the properties of objects to transfer with them, which wouldn’t work with shaders. I’m still thinking about the first idea - although as much coding as that would take I’ll need to see if it’s worth it. Otherwise I’ll think about some workaround.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.