Iris - Immediate Mode UI library, based on Dear ImGui

Wow this looks fantastic, thanks for sharing it! Im glad the library was able to be helpful.

2 Likes

i was riding in my lamborghini and suddenly crashed to see myself here
this module is very good thanks for your contribution alyrianix to this community :heart:

1 Like

Anyway to prevent this print loop spam? Iā€™m trying to fetch the input text.
image

local Iris = require(game:GetService("ReplicatedStorage").Iris).Init()
function Test(va)
	print(va)
end
Iris:Connect(function()
	-- use a unique window size, rather than default
	local windowSize = Iris.State(Vector2.new(300, 400))

	Iris.Window({"SETTINGS"}, {size = windowSize})
	Iris.Tree({"GAME SETTINGS"})
	Iris.PushConfig({ContentWidth = UDim.new(0, 250)})
	local InputText = Iris.InputText({[Iris.Args.InputText.TextHint] = "KILL SOUND EFFECT"})
	Iris.PopConfig()
	Test(InputText.text.value)
	Iris.End()
	Iris.End()
end)

Is there also an option to disable the Input Text next to the input box?

1 Like

Every frame you are printing out the value of the textbox, which when empty will print out an empty string, which is whats happening. You can use events to only print when the value is changed, however this behaviour has been changed since and the next release should make it easier to check for this.

To temporarily fix this you can cache the value of the text each frame and check whether it has changed from that.

Regarding the Input Text string, if you set the Text argument to an empty string then it will be empty.

3 Likes

Hopefully, this UI library is so good, too bad it lacks events, canā€™t wait for next release!

1 Like

Version 2.0.0 released

Added:

  • Iris.Radio
  • Iris.CollapsingHeader
  • Iris.SliderNum
  • Iris.DragNum
  • Iris.InputVector2
  • Iris.InputVector3
  • Iris.InputUDim
  • Iris.InputUDim2
  • Iris.InputColor3
  • Iris.InputColor4
  • Iris.Selectable
  • Iris.Combo
  • Iris.Tooltip
  • Hover, CtrlClick, DoubleClick, RightClick events for many widgets

Changes:

  • events now are functions, and need to be called to poll their value.
  • for creating custom widgtes, events are now tables with Init and Get methods.
  • removed widget info window in the DemoWindow.
13 Likes

Made this for a game im working on, creates the checkpoints for a race track

Took a while to figure out how to use widgets correctly but afterwards it was amazing

3 Likes

Long time ago I decided to make a visual debugging user interface for my 2D game engine. Originally I used dat.GUI. However, as soon as I saw that ImGUI was finally ported to ROBLOX I immediately switched to it. With no doubt I have to say that it was worth it.

Itā€™s a really good module and very enjoyable to work with.

I have one small problem with it:
For some reason it really likes to throw the not enough Iris.End and too many Iris.End errors at the same time when I clicked a button. Just when I clicked it. I have no idea what is the cause for it. (I decided to just comment out these errors because it was really distracting from the other prints and warns that I was trying to focus on.)

Other than that, great job!

5 Likes

When i disable resizing, and i move the window or click it shows the resize handle again, also i can resize by grabbing the edges.

1 Like

Update v2.1.0

New Widgets

  • Iris.SeparatorText
  • Iris.MenuBar
  • Iris.Menu
  • Iris.MenuItem
  • Iris.MenuToggle
  • Iris.InputRect
  • Iris.DragVector2
  • Iris.DragVector3
  • Iris.DragUDim
  • Iris.DragUDim2
  • Iris.DragRect
  • Iris.SliderVector2
  • Iris.SliderVector3
  • Iris.SliderUDim
  • Iris.SliderUDim2
  • Iris.SliderRect

Remastered Widgets

  • Iris.InputNum
  • Iris.InputVector2
  • Iris.InputVector3
  • Iris.InputUDim
  • Iris.InputUDim2
  • Iris.InputColor3
  • Iris.InputColor4
  • Iris.DragNum
  • Iris.SliderNum

Internal Changes

  • Added types to all files.
  • Reorganised file layout and function locations.
  • Fixed certain types.
  • Changed unicode characters to ImageLabels.

Docs

  • Changed the format of the docs.
  • Added widget subcategories to break up the docs.
  • New Event docs page.

Other Changes

  • New in-progress testing suite.
  • Added wally.toml file.
  • Updated Aftman dependencies.

Credits

Huge thanks to SirMallard for developing the majority of this release!

7 Likes

I canā€™t wait to use the new menu feature in my plugin. Thanks to both of you :pray:

1 Like

This happens after i changed the theme to dark theme. Its from the Iris - Demonstration game

.

yeah theme settings is broken atm

Slightly new to this, how would i go about implementing a sort of player list that you can select each player (or all) and also having a custom console? I am having a bit of trouble trying to understand how to ā€œconnectā€ events like ScriptContext and PlayerAdded.

This seems incessant. Why not just code like a normal human being?

Have a read about the ImGui paradigm. Unity offers itā€™s own version of an immediate mode GUI system which works in the same way as Iris and many AAA studios use Dear ImGui itself during software testing, so itā€™s not an ā€˜unnormalā€™ way of coding.

The only way of making UI in Roblox is through a Retained Mode GUI, where you have to sore the reference to every object created. Therefore, if you wanted to create some debug text for a string variable, you would have to create a TextLabel and store a reference to it and then update the value every time the string updates. This is a lot of work to go just to create a single updating TextLabel.

Iris, Dear ImGui and the Unity ImGui are all Immediate Mode GUI libraries. Therefore, you declare what you want to see and the library handles all of the displaying part. Instead of having to keep a reference to a TextLabel, you just delcare that you want a TextLabel and it appears. Behind the scenes, Iris manages all of the instance creation, updating and destruction without you having to worry. The reason why you check every frame is because otherwise you have to hook onto events in your code. If the string variable from above updates, you have no way of checking if it changed unless by explicitly calling the UI every frame. It may seem incessant, but there is not a better way of managing it. Iā€™ll also add that on the low-level, every system is redrawing everything every frame, so in languages like C++ you just add your ImGui code within your main loop. Roblox just makes it easier by offering events to run code through, but there are still many times when you are running code every frame.

Overall, the library abstracts away all the annoying tasks of creating states and managing instances and leaves you with a simple API to just add and remove whenever you need. Hopefully this makes more sense.

Iā€™d recommend reading the page on Dear ImGui about the ImGui Paradigm.

3 Likes

reminds me of steam custom themes before those were removed

This plugin is useless and a waste of devs times.

Nobody is making a text label to debug our code. We are all printing our issues.

This is just going to make my game low quality because I am essentially using free model GUI instead of using my own GUI. Furthermore, ā€œBehind the scenesā€ is quite dramatic due to the fact roblox automatically does all that for you.

I cant tell if you are talking about variables or text labels.

If you are talking about textlabels you can check when it changed via this:

textLabel:GetPropertyChangedSignal(connect(function(changed))
if changed == "Text" then
print("changed.")
end
end)

If you are talking about variables you can just run the code the same time you change the variable or you would do something like

repeat task.wait() until oldvariable ~= newVariable

I disagree, also itā€™s not a plugin, itā€™s a library. ImGui (the library itā€™s based off of) is incredibly popular and widely used because of how easy it makes otherwise complex debugging procedures (events, windows, dragging & rescaling, visualizing complex information, etc.) and just the overall massive benefit having a visual debugging window provides. I personally donā€™t think its best fit for actual in-game UIs, but it has immense potential in debugging and even just simple things like tweaking and testing features.

Also, no, it isnā€™t dramatic that the library handles ā€œbehind the scenesā€ stuff. If you actually read through the documentation and understood how it worked, youā€™d see itā€™s an immediate mode library, and the syntax is designed to be very easy to implement. Due to this, it has to be significantly more technically advanced to save a lot of these headaches from the developers using it. It does manage instances for you, because it keeps track of states (windows, components, interactions) and events and automatically reformats and re-renders the UI to fit such.

I totally get people voicing concerns about stuff and how it may impact newer developers, but this post was just incredibly misinformed and, for lack of a politer way to say it, seems like you are totally clueless to what exactly the library is about and how it is useful.

Either way, whether you agree with me or not, making a bunch of blanket criticisms of a library that arenā€™t even really applicable to the context is obviously unfair to the creator, but also discourages people from picking up what could be an immensely useful tool to them.

13 Likes

Roblox output is literally all you need. The ā€œcomplexā€ information is only complex information for rookie devs. It is more beneficial to just learn how to be a normal dev. Its a lot easier to debug with actual debugging strategies rather than getting some plugin

It has to be a plugin to run code in studio