pkdawson / imgui-godot

Dear ImGui plugin for Godot 4
MIT License
318 stars 18 forks source link

Image does no work with AtlasTextures and their Regions #49

Closed critcap closed 5 months ago

critcap commented 6 months ago

The Image widget appears not working correctly when using AtlasTextures. It will display the whole AtlasTexture and not just the specified region of the AtlasTexture e.g. The whole TileSet is shown instead of the a single tile.

maidopi-usagi commented 6 months ago

Maybe a workaround...you could additionally use AtlasTexture.Region.Position / AtlasTexture.Atlas.GetSize() as parameter uv0, and AtlasTexture.Region.End / AtlasTexture.Atlas.GetSize() as parameter uv1 on Widgets.Image() or Widgets.ImageButton() for displaying regions correctly

pkdawson commented 6 months ago

This is a good feature I hadn't thought of. I'll add methods which take an AtlasTexture and set the UV parameters.

pkdawson commented 5 months ago

Added in v4.1.0