Portponky / better-terrain

Terrain plugin for Godot 4
The Unlicense
509 stars 24 forks source link

Ability to zoom less than 100% tile size #80

Closed BertrandBordage closed 6 months ago

BertrandBordage commented 6 months ago

With large tiles like 128×128 pixels, it can be hard to navigate in the Terrain tab, as can be seen with this Kenney tileset: image

This appears to be because the minimum zoom corresponds to 1 screen pixel per tile pixel. So we can zoom out up to the original image size, but not to fit the whole tileset in view.

It would be awesome if we could zoom out more to match the largest dimension. If the tileset has a large height, then zoom out until the whole height is in view, with the width centered. And vice versa. That would keep the view constrained like this and not like the vanilla Godot view where you can move outside the view of any tile.

The default zoom could be that minimum zoom where all tiles are in view.

And obviously, thank you so much for this great plugin! You make 2D Godot terrains a lot clearer and more powerful.

Portponky commented 6 months ago

Added in 7482bd44efc8adf5ef46d952b74667fbc420b505 as a project setting. By default it's still 1x to 8x, but you can change the minimum down to 0.1x and the maximum up to 32x to tailor it to the specific project's tiles.

BertrandBordage commented 6 months ago

Excellent, thank you very much! I'm going to test it in the upcoming days.

Portponky commented 6 months ago

Shows up here.

Min and max size for tile zoom

I've done a number of other improvements today (finally had some time), they will appear in the asset library version in a day or two.

Portponky commented 6 months ago

Available in the asset library now. Leaving the ticket open for now in case you have any feedback.

BertrandBordage commented 6 months ago

I tested, it's working great! Thank you again :)