Closed Michael-48 closed 2 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
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:These are a few arguments which I think can be compacted in various ways:
Vector2
which is converted into aUDim2
, because there's not a reason I can see for wanting full width or height images, but I might be proven wrong.RectOffset
andRectSize
properties, which is equivalent to theuv0
anduv1
Dear ImGui arguments. However, Roblox also has aRect
datatype which seems like and obvious candidate which would turn two arguments into one.ImageColor
andImageTransparency
properties, and for now I've just used the Text style from the config. This means you can just push and pop the style if you need to change the image and makes sense in my opinion.FramePadding
style to control. I haven't included this yet, and I don't know whether there would be a better way of controlling this, such as through another border style.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.