Iris - Immediate Mode UI library, based on Dear ImGui


is there supposed to be a docs page for progress bars?

It is there it’s just the search is broken

2 Likes

best thing to have ever been made
i dont care if its meant for debugging ill make all my UI out of this
it removes the work from me and also it has that vgui look

1 Like

this is legitimately awesome, got to be one of the best opensource libraries ever released here. Replacing all my debug guis pronto

1 Like

Do you plan on updating the demo game with the newest features?

I have a strange issue where i cannot render a list that is a sub table of module script, the entries that appear are wildly inaccurate. If i try to just to render a number value in the module script, it works fine. But this doesnt.

iris.Tree({"List: "})
		for i, v in pairs(UpdatingTable.Tab) do
            Iris.Text({tostring(v)})
        end
	iris.End()

You would have to do something like this:

iris.Tree({"List: "})
		for i, v in pairs(UpdatingTable.Tab) do
            Iris.PushId(i)
            Iris.Text({tostring(v)})
            Iris.PopId()
        end
	iris.End()
1 Like

Doesn’t work. Nothing appears rendered anymore under the list.

What’s actually in the table? Does the data in the table change?

Thsi works fine for me:

local Data = {}

Data.Tab = {1, 2, 3, 4, 5, 6}

Iris:Connect(function()
	Iris.Window({"Test"})
	
	Iris.Tree({"Tab:"})
	for _, v in Data.Tab do
		Iris.PushId(`Tab_{v}`)
		Iris.Text({tostring(v)})
		Iris.PopId()
	end
	Iris.End()
	
	Iris.End()
end)

I suspect the problems on my end, i tried and you are right, dynamic tables in normal scripts work fine. However the dynamic tables i am referencing are in what are called proxy tables, ill do more research soon and figure out if it is that.

1 Like

If I close an Iris window using the exit (X) button, how do I reopen it? Is there some easy bool I can change?

I get that I can do something like:

local windowVisible = Iris.State(true)

Iris:Connect(function()
	if windowVisible:get() then
		Iris.Window({"My First Window!"})
		Iris.Text({"Hello, World"})
		Iris.Button({"Save"})
		Iris.InputNum({"Input"})
		Iris.End()
	end
end)

Input.Keyboard.KeyDown:Connect(function(key)
	if key == Enum.KeyCode.E then
		windowVisible:set(not windowVisible:get())  -- Toggle the window
	end
end)

However, the exit button permanently kills the window. The toggle no longer works.
image

Is there not any way to reopen a window after closing it with the exit button?

just use widget’s states

local windowVisible = Iris.State(true)

Iris:Connect(function()
	Iris.Window({"My First Window!"}, {
		isOpened = windowVisible -- https://michael-48.github.io/Iris/api/Window#Window
	})
	Iris.Text({"Hello, World"})
	Iris.Button({"Save"})
	Iris.InputNum({"Input"})
	Iris.End()
end)

game:GetService("UserInputService").InputEnded:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.E then
		windowVisible:set(not windowVisible:get())
	end
end)
3 Likes

How did you guys learn this? For me, I feel like it’s not detailed enough. The API shows the different types of events / functions but don’t really show how to implement it. That’s probably just me but yeah. I feel really dumb right now :confused:

image
I learned most of it by looking at stuff in the demoWindow

1 Like

structure like this doesn’t work for me, it just stops at first selectable
am i doing something wrong?

local sharedIndex = Iris.State("none")
Iris.Combo({"Selected"}, {index = sharedIndex})
for i, item in array do
	Iris.Selectable({item.value.Text, item.key}, {index = sharedIndex})
end
Iris.End()

upd: found the fix, but i don’t get is it intended like that

iris.SetNextWidgetID(item.key)

that’s what I did too, it’s probably the best way of learning iris

Yeah this is intended you can either use SetNextWidgetId or Push / Pop id

1 Like

the design looks really similar to reshade.
nice!

Would be interesting to see components of this for React UI, and I think it would be beneficial to look into

Awesome resource!

Only thing I’d suggest is returning a disconnection callback function to StateClass:onChange()

That way people can observe an iris state cleanly with a maid class etc.

Maid:Add(IrisState:onChange(function() end))

Obviously this isn’t hard to add ourselves, but it’s something I think should already exist

4 Likes