michael-48 / iris Goto Github PK
View Code? Open in Web Editor NEWIris is an Immediate mode GUI Library for Roblox, Based on Dear ImGui
Home Page: https://michael-48.github.io/Iris/
License: MIT License
Iris is an Immediate mode GUI Library for Roblox, Based on Dear ImGui
Home Page: https://michael-48.github.io/Iris/
License: MIT License
On player reset, Iris should maintain visibility regardless of PlayerGui ResetOnSpawn and of any ScreenGui ResetOnSpawn, this currently does not happen and resetting leads to an error.
Every time I try to drag the window (titlebar) somewhere else, nothing happens. This is my code:
wait(5)
local StarterPlayerScripts = game.StarterPlayer.StarterPlayerScripts
local Iris = require(StarterPlayerScripts.Iris).Init(script.Parent)
Iris:Connect(function()
local windowSize = Iris.State(Vector2.new(350, 250))
Iris.Window({"Window"}, {size = windowSize})
Iris.End()
end)
Sinks any input onto children widget, effectively making them disabled. Can't use Iris.Disabled since that is a property already. Either Iris.Inert or Iris.InActive?
Mentioned by Sluethen on the Roblox OSS Discord server.
Table rows are often not aligned if the items are too large. I'm not sure quite was courses this and at the moment I can't remember how Iris.Table handles unevenly sized boxes.
Additionally, if Roblox introdcues a UIFlexLayout then that might be useful to fix this.
I noticed that having a widget in a conditional block causes it to have the same widget ZIndex as the first widget after the conditional block.
It seems like a non-trivial issue to solve, so I'd also appreciate any workarounds.
local err = Iris.State(nil)
if Iris.Button("Cause error").clicked() then
err:set("An error has occurred!")
end
if err:get() then
Iris.Text(err:get())
end
Iris.Text("Some text afterwards")
no close keybind, or full close
Datatypes
Im trying to create this exact stack however I getting an error saying:
Callback has too many calls to Iris.End()
or To Few calls to Iris.End()
I tried to follow the demo you have on the docs page and then diagnose by looking at your source but I dont know why this is an issue.
Iris.Init()
Iris:Connect(function()
Iris.Window({"MENU", [Iris.Args.Window.NoResize] = true}, {size = Vector2.new(100, 100)})
if Iris.Button({"Spawn"}).clicked() then
RemotesManager.Client:Get("SpawnPlayer"):SendToServer()
Iris.End()
end
Iris.End()
end)
Unsure whether it's my issue or not, but any request gets rejected when using Iris to send it.
Button code:
if Iris.Button({ "Button" }).clicked() then
local remote = remotes.Client:Get("PrintMessage")
remote:SendToServer("This should be printed")
end
Server-side code:
remotes.Server:Get("PrintMessage"):Connect(function(plr, message)
print(message)
end)
Error itself:
net.out.definitions.ClientDefinitionBuilder:54: Expected Promise rejected with no value.
Everything works perfectly fine when using a vanilla Roblox button and the message gets printed.
Rbxnet: https://rbxnet.australis.dev/
Literally dying because of this error, I have no idea why this is happening.
Code:
-- this thing handles the shop
local StarterPlayerScripts = game.StarterPlayer.StarterPlayerScripts
local Iris = require(StarterPlayerScripts.Token_Debug.Iris).Init()
local TokenEvent = script:WaitForChild("TokenEvent")
local BuyFunction = script:WaitForChild("BuyFunction")
Iris:Connect(function()
Iris.Window({"Shop Debug"})
Iris.Text({"Heya, this is a particle shop I guess."})
if Iris.Button({"Buy the 1st effect and equip (free)"}).clicked() then
local status = BuyFunction:InvokeServer(1, game.Players.LocalPlayer)
if status == "toopoor" then
warn("user is poor")
elseif status == "success" then
print("you did it")
elseif status == "failed" then
warn("datastore fail")
end
end
local tokenmnt = Iris.InputNum({"Token Amount"})
if tokenmnt.numberChanged() then
TokenEvent:FireServer(game.Players.LocalPlayer, tokenmnt.state.number)
end
Iris.End()
end)
The error:
Callback has too few calls to Iris.End() - Client - Internal:266
21:58:57.629 Stack Begin - Studio
21:58:57.629 Script 'StarterPlayer.StarterPlayerScripts.Token_Debug.Iris.Internal', Line 266 - function _cycle - Studio - Internal:266
21:58:57.629 Script 'StarterPlayer.StarterPlayerScripts.Token_Debug.Iris', Line 86 - Studio - Iris:86
21:58:57.629 Stack End - Studio
Post from xswezan on the Roblox OSS Discord Community:
I noticed that using Iris in a plugin widget wasn't possible, so I forked Iris and added this functionality (partially). I added 4 new settings to the config; CustomInputBeganEvent, CustomInputChangedEvent, CustomInputEndedEvent, CustomMousePositionCallback.
I wouldn't say it's the best fix to this problem and I mainly did this to test. It's a bit hacky to do this but it works.
You have to apply the custom events in the config BEFORE you call .Init, which is the biggest problem here
local Iris = require(script:WaitForChild("Iris"))
Iris.UpdateGlobalConfig{
UseScreenGUIs = false;
CustomMousePositionCallback = function()
return ViewportWidget:GetRelativeMousePosition()
end;
CustomInputBeganEvent = EventLayer.InputBegan;
CustomInputChangedEvent = EventLayer.InputChanged;
CustomInputEndedEvent = EventLayer.InputEnded;
}
Iris = Iris.Init(ViewportWidget)
Still works though ๐คทโโ๏ธ
Gyazo Screen Video
I'd like to make a pull request out of this, but I don't think it's really that well made yet to go in the actual build, it's mainly a proof of concept
The 2.1.3 version on Wally is broken.
To get the module to work I had to specify the version with Iris = "michael-48/iris@=2.1.1"
(since it's the version of the latest github release, I skipped 2.1.2)
This is not good at all since by default Wally will auto-update packages to the latest bug fix version (indicated by the last number of the version), so all wally installations will default to this broken version.
I recommend just uploading a fixed package as 2.1.4.
Updating properties leads to an error, this should be fixed asap.
Iris should throw an error you tried to use it before calling .Init(). Removed the call by accident from my impl of it sometime ago, and only just now noticed it wasn't working ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.