FreshRSS

Normální zobrazení

Jsou dostupné nové články, klikněte pro obnovení stránky.
PředevčíremHlavní kanál

How do I place the local center of my tilemap at 0,0?

If I have a tilemap that is 4x8, positioned at 0,0 in the editor as follows:

4x8 tilemap positioned at 0,0

What code would I use such that it ends up "centered" when my game runs?

I'm hoping for an end result that would look like this:

Demonstration of 4x8 tilemap centered by moving the tilemap to -24x-24

As you can see, the tilemap has been moved left 24 pixels and up 24 pixels. This example is manually done, but I'd like to be able to do it using the Godot APIs so that tilemaps of different dimensions can be centered.

❌
❌