Iris - Immediate Mode UI library, based on Dear ImGui

I’ve just started using the library and so far I’m super happy with it!
I will now use this in all my projects for debugging and visualizing data!
Thank you to the devs maintaining and supporting the creation of the resource!!

3 Likes

Is there a way to easily add image labels? I’m looking to make admin UI with this and player images are much easier than selecting usernames

Who’s we with the modification of all?

Personally, I don’t use debug UIs much but effective debugging is usually done through the efforts of utilizing UI, breakpoints, watch variables, and printing altogether. Only a small percentage like you will dare to miss out on tools that may help you throughout your development career.

There is no problem with you not using it. There is a problem with you interpret on how it is used along with the biased language. This seems helpful when you just want to not design UI but you’re releasing a project that engage in such like physics and rendering with configurations.

try to make it as a custom widget maybe

We are working on adding Images but I’m not sure about the best way to accommodate all the different image options into one simple widget.

For now, as has been mentioned, you are able to create your own widget for them with the settings you need.

Its happening again, when character dies and respawns the ui disappears.

Oh, i want to ask about custom widgets… Documentation doesn’t really help much, and i mean the page “Creating Custom Widgets” to be exact.

I’ve managed to understand, that Iris.Internal.WidgetConstructor is the core function for constucting widgets. But when i runned it with all properly written arguments it returned absolutely nothing. I couldn’t even get where the widget got stored and how do i activate it.

Instead, i had to look to the source code to find what actually triggers the widget. And it was Iris.Internal._insert which isn’t mentioned on the page at all.

I managed to create the widget by the tutorial, but not get how to run it.

It doesnt work after character respawns. Am I the only one with this issue?

Yes, sorry about that. I added some extra information to that page, but it hasn’t been published yet, so it would not have made much sense.

1 Like

Where is your script placed and are you getting any error? It works fine when placed under StarterPlayerScripts but not under StarterCharacterScripts.

I have a safewall where only the server can clone the script into player who have the right. Couldnt access playerscripts from server so I put in playergui. No errors unless I attempt to clone it back into the playergui again then it says that the module can only be initlized once.

So the issue is that every time you spawn, the scripts inside of PlayerGui will be created and run, which attempts to Initialise Iris multiple times. I’m not sure what the best way to selectively replicate this into the client. You could possibly have a script inside the PlayerScripts which waits for the Iris module to be passed into StarterGui and then moves it into PlayerScripts so it doesn’t respawn?

I tried cloning it into playergui and make script pick it up into playerscripts. It still didnt however if you cloned it into player itself then call a remote event to the client to pick it up then it works its not necessary to call remotevent.

Thanks for the help!

1 Like

ii’m not sure that PlayerGui is great place to store local scripts (except they’re in guis) at all

I ecnountered a bug on touch devices where slidernum still responds on taps on screen even when not pressing on the slider and the window, It seems to happend after I used the drop down on the windows not sure.

I’m absolutely confused on how to sync states with custom Instance attributes and ValueBases (Instances values). I want to use this as a editor not just to see data. Is there any good examples of this? So far the demo just shows iris api calls and no real integration with modifying values in a real world script, just editing iris’s own state.

I figured it out, this code now has 1:1 sync with explorer. If this is the incorrect or inefficient method of doing this, let me know. Im not sure why I have to use the :set method after every line, I feel like I must be doing something wrong.

local Iris = require( game.ReplicatedStorage:WaitForChild("Modules"):WaitForChild("Iris") ).Init()

local testPart = Instance.new("Part")
testPart.Parent = workspace
testPart.Anchored = true
testPart.Position = Vector3.new(0,5,0)
testPart.Size = Vector3.new(10,10,10)
testPart:SetAttribute("AttributeColor",Color3.new())
testPart:SetAttribute("MyAwesomeName","noname")

local num = 1

--task.spawn(function()
--	while task.wait() do
--		num = num + 1
--	end
--end)

task.spawn(function()
	while task.wait(1.5) do
		--- randomize the part color, use color3.fromrgb and mathrandom 255
		testPart.Color = Color3.fromRGB(math.random(255), math.random(255), math.random(255))
	end
end)

Iris:Connect(function()
	Iris.Window({"imgui"})
	
	--local InputText = Iris.InputText({ "Input Text Test", [Iris.Args.InputText.Text] = ("This Number is " .. num)})
	--if InputText.textChanged() then
	--	num = InputText.state.text.value
	--end
	
	---- roblox datamodel stuff
	
	local brickNameAttribute = Iris.InputText({ "Workspace Brick Custom Attribute Name", [Iris.Args.InputText.Text] = ("my name is " .. testPart:GetAttribute("MyAwesomeName"))})
	if brickNameAttribute.textChanged() then
		print(brickNameAttribute)
		testPart:SetAttribute("MyAwesomeName",brickNameAttribute.state.text.value) 
	end
	brickNameAttribute.state.text:set(testPart:GetAttribute("MyAwesomeName"))

	local brickColorAttribute = Iris.InputColor3({"Workspace Brick Custom Attribute Color"}, {color = testPart:GetAttribute("AttributeColor")})
	if brickColorAttribute.numberChanged() then
		testPart:SetAttribute("AttributeColor",brickColorAttribute.state.color.value)
	end
	brickColorAttribute.state.color:set(testPart:GetAttribute("AttributeColor")) 

	local brickColor = Iris.InputColor3({"Workspace Brick Color"}, {color = testPart.Color})
	if brickColor.numberChanged() then
		testPart.Color = brickColor.state.color.value
	end
	brickColor.state.color:set(testPart.Color)

	local brickSize = Iris.InputVector3({"Workspace Brick Size"}, {number= testPart.Size})
	if brickSize.numberChanged() then
		testPart.Size = brickSize.state.number.value
	end
	brickSize.state.number:set(testPart.Size)
	
	Iris.End()
end)
1 Like

You could try looking at a Iris.WeakState which should reset. The best example in the demo window is to look at styling. I myself am not so sure how to go about this. Try having a look at examples of syncing instances and code without Iris?

1 Like

I get this error everytime I add a 3rd argument to InputText

The 3rd argument is “false”
image

image

Is the github documentation down?
Can’t reach it? :frowning: