SirMallard / Iris

Iris is an Immediate-Mode GUI Library for Roblox for creating debug and visualisation UI and tools, based on Dear ImGui,
https://sirmallard.github.io/Iris/
MIT License
164 stars 25 forks source link

Iris.Image, Iris.ImageButton #45

Closed Michael-48 closed 2 months ago

SirMallard commented 6 months ago

I've added in the Iris.Image widget to the image branch, but I wasn't sure about the best way to deal with the arguments. Looking at the Dear ImGui Image API, it has the arguments of image, the image size, a UV min and max argument and then tint and border colours:

IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& tint_col = ImVec4(1, 1, 1, 1), const ImVec4& border_col = ImVec4(0, 0, 0, 0));

These are a few arguments which I think can be compacted in various ways:

These are the issues and questions I have from making the first version and I would like some input on how to go forwards with the Image widgets.

SirMallard commented 3 months ago

The active branch is: image

The main question I have about implementing images is:

There are multiple different ScaleTypes which I would like to be present, but some of them have extra properties which also need to be set to work.

I'm not sure about the best way to go around supporting all of these properties in a concise and clean single API. Should these be separate APIs or is there a better way of accommodating them all?

@Michael-48