Iris - Immediate Mode UI library, based on Dear ImGui

looks like the creator changed his nickname
try this link

upd: um, turns out it's not changed. but new repository is pinned on the account anyway

should be ā€œrblx.gamesā€ not ā€œrbxl.gamesā€

1 Like

is the correct link yes.
thanks @ow9u & @D_cbl.

1 Like

Itā€™s been transfered over to myself, because the Michael did not have enough time to contribute to Iris, but nothing should have changed apart from the github links.

1 Like

Alright, thank you for elaboration of whatā€™s happened.

Iā€™ve just been reading through this whole post, and Iā€™m very interested, I can never seem to make perfect UI, the scaling is always off and Iā€™m bad at mixing colours and so on, so this would save a lot of time.

However, my main concern is that a few people are arguing that this is bad, and I was wondering whatā€™s bad about it, and whether I am okay to use it.

Also, what is the difference between this and ImGui? The only difference I noticed was that ImGui has a colour pallet, but Iris doesnā€™t, you have to type in the RGB numbers, but thatā€™s the only difference I can see, which isnā€™t that big of a deal, and of course, ImGui is rounded which I would like an option for on Iris, but I donā€™t mind.

Forgot to mentionā€“I have never seen a UI Libary like this before, its a lot easier than most others, most others you have to type each individual UI Element that exists on Roblox, including scale, you have to scale it yourself, which as I said Iā€™m not good at scaling UI, this is perfect, it already has a set theme, scaling is already done for you, all you have to do is code the window and its contents!

Also, how do you make it so you can set the theme or perhaps your own custom theme to specific windows?

Also, there isnā€™t much on the documentation I would really appreciate the help.

To add on to this, Iā€™m also trying to set the Position of a window in the middle of the screen (.5 ,.5) but it seems setting the position to scale just breaks Iris, what am I supposed to do?

Also, is there a way to make the widgets centred in the middle of the window, rather than always on the left?

Like this, how do I put the ā€œNoā€ button beside the ā€œYesā€ button?
image

use sameline

Iris.Text({"are you sure?"})
Iris.SameLine() do
	Iris.Button({"yes"})
	Iris.Button({"no"})
end Iris.End()

(the do isnā€™t important itā€™s just for formatting)

Eventually, I found that out, but itā€™s slightly different to how you did it.

Iris.SameLine({ nil, nil, Enum.HorizontalAlignment.Center }) -- the first nil specifies the padding in pixels between the buttons.
do
    Iris.Button({"Yes"})
    Iris.Button({"No"})
end
Iris.End()
1 Like

Iris can be used like any other UI library, however itā€™s aimed at creating debug and visualisation UI and the UI for development tools which the player never really sees. Itā€™s main focus is sacrificing specific styling and looks but benefits from being very easy to add to an existing codebase. But you can use it how you like, youā€™ll just be limited to how Iris does things.

Iris exists because we canā€™t use the original Dear ImGui, and so we had to port it over and build it using Roblox instances in Lua.

The person who was claiming Iris was bad just wanted to fight someone over it. The actual Dear ImGui is used by huge game studios like Ubisoft and Rockstar for their own games and has a huge user base and Iris attempts to bring over some of that to the Roblox ecosystem. It just happens that nothing similar to Iris really exists on Roblox already.

3 Likes

Fair enough, thank you for the info!

Would you mind helping me with something Iā€™m currently stuck on?ā€“In the Demo Window it shows that creating tables and columns is possible, but Iā€™m not sure how the rows is created, Iā€™ve looked through the demoWindow module and I cant see any method how it creates the extra rows.

Heres the code Iā€™m talking about:

Iris.Text({ "Table with Customizable Arguments" })
            Iris.Table({
                [Iris.Args.Table.NumColumns] = 4,
                [Iris.Args.Table.RowBg] = TableRowBg.value,
                [Iris.Args.Table.BordersOuter] = TableBordersOuter.value,
                [Iris.Args.Table.BordersInner] = TableBordersInner.value,
            })
            do
                for i = 1, TableNumRows:get() do
                    for i2 = 1, 4 do
                        Iris.NextColumn()
                        if TableUseButtons.value then
                            Iris.Button({ `Month: {i}, Week: {i2}` })
                        else
                            Iris.Text({ `Month: {i}, Week: {i2}` })
                        end
                    end
                end
            end
            Iris.End()

            Iris.Checkbox({ "RowBg" }, { isChecked = TableRowBg })
            Iris.Checkbox({ "BordersOuter" }, { isChecked = TableBordersOuter })
            Iris.Checkbox({ "BordersInner" }, { isChecked = TableBordersInner })

            Iris.SameLine()
            do
                Iris.RadioButton({ "Buttons", true }, { index = TableUseButtons })
                Iris.RadioButton({ "Text", false }, { index = TableUseButtons })
            end
            Iris.End()

            Iris.InputNum({
                [Iris.Args.InputNum.Text] = "Number of rows",
                [Iris.Args.InputNum.Min] = 0,
                [Iris.Args.InputNum.Max] = 100,
                [Iris.Args.InputNum.Format] = "%d",
            }, { number = TableNumRows })

            Iris.End()

You can see the how to edit Columns in the Iris.Table() method. but not an option of Rows.

you seem to know a lot about useless resources and posts (you make them)

also you use ai for your resources

1 Like

Just to clarify, I donā€™t want to create the same button every time in the table. I have my own buttons, each with different properties, but Iā€™m not sure how to put each one in its own row.

So, for instance, on a mobile phoneā€™s home screen page, you have like what? Four or 5 apps in each column right, and in rows, you have eight or something, like a UIGridLayout, you know?

Hello! Today I managed to add a new widget to the Library!

Introducing Iris.ToggleSwitch()!

Okay, so itā€™s not as exciting as it sounds, but the truth is, I just wanted to know what it would be like to add your own custom widgets and let me tell you, itā€™s quite the faff, but I managed to do it anyway, and you can have it for yourself!

Now I must warn you; itā€™s not the greatest, Iā€™m not a pro at GUI, and it doesnā€™t adapt very well to different themes, but the point is it works just fine, if you wish to improve it, by all means, please do so!

Iris with Toggle Switch widget: https://create.roblox.com/store/asset/137001338842582/Iris-Introducing-IrisToggleSwitch

Example:

local Iris = require(game:GetService("ReplicatedStorage").Iris).Init()
local TweenService = game:GetService("TweenService")
local ASSMVS = false


local function Connect()
	local ToggledState = Iris.State(false) -- The Inital/Default Toggle State.
	
	Iris.Window({"Iris.ToggleSwitch() Demo [Experimental]"})
	do
		local ToggleSwitch = Iris.ToggleSwitch({
			"I am a new ediiton to the Iris API! Woohoo! Toggle me and see what happens!",  -- Just like the Iris.Checkbox(), it has a TextLabel beside it.
			[Iris.Args.ToggleSwitch.Text] = "I am a new ediiton to the Iris API! Woohoo! Toggle me and see what happens!", -- Just like the Iris.Checkbox(), it has a TextLabel beside it.
			[Iris.Args.ToggleSwitch.Size] = UDim2.fromOffset(0, 0) -- Also add a custom size if you wish.
			[Iris.Args.ToggleSwitch.NoToggleText] = false -- When set to true it hides the status text that displays inside the toggle. Toggled "I", Untoggled "O".
		},
		{
			isToggled = ToggledState -- The Inital/Default Toggle State.
		})

		-- Events; similar to Irs.Checkbox() really. However, there are also 2 others "righttoggled" and "ctrltoggled", but i couldent figure out how to set them up, maybe you can!
		if ToggleSwitch.toggled() then
			ASSMVS = true
		end
		if ToggleSwitch.untoggled() then
			ASSMVS = false
		end
		if ToggleSwitch.hovered() then
			print("hovered!")
		end
		
		
		local ASpecialSecretMessage = Iris.Text({"BOO!"})
		ASpecialSecretMessage.Instance.TextSize = 100
		ASpecialSecretMessage.Instance.Visible = ASSMVS
	end
	Iris.End()
end

Iris:Connect(Connect)

Heres what it looks like:

Untoggled
image
Toggled
image

PS Sorry about the over-brightness of the images, thatā€™s just an issue I have with the Snipping Tool.

3 Likes

How did you get a console that looks nice like that? I tried and it ended up looking bad

i remade that and had to get rid of everything besides the first line, if thats what made it look bad for u

logtext:match("^(.-)\n")


isnt this just a boolean?
Looks like it just goes true&false