Hi guys, it's been a long time I am not using Gideros (but always lurking) and I am happy to see that the community is still thriving!
Now I forgot almost everything I learned in the past years of using gideros, and something is probably changed, but I hope I will recover something on the way..
I came back to see if I can make use of ImGui: it's the first time I am using it and I am moving my first steps.
I basically copied the first example found on github and it crashes my windows player. Shall I do something to enable the plugin in the windows player? Am I doing something unexpected?
This is my code so far, in main.lua, thank you!
require "ImGui"
function SetMainUI()
local UI = ImGui.new()
local IO = UI:getIO()
local FontAtlas = IO:getFonts()
local Font = FontAtlas:addFonts{ {"fonts/CharisSIL-Regular.ttf", 18}, {"fonts/CharisSIL-Bold.ttf", 18}, {"fonts/CharisSIL-Italic.ttf", 18} }
IO:setFontDefault(Font[1])
FontAtlas:build()
UI:pushFont(Font[1])
UI:text("Font1")
UI:popFont()
return UI
end
ui = SetMainUI()
stage:addChild(ui) |
edit: I forgot the basic info. Windows10, Gideros 2022.9
Comments
PS: I added the imgui plugin in the Plugins
Likes: pie
UI:pushFont(Font[1])
you should use
UI:pushFont(FontAtlas:getFont(1))
?
see https://github.com/MultiPain/Gideros_ImGui/ for docs
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
-- window01 = imgui:beginWindow("Window 01") -- no close button (X)
Likes: pie
@keszegh unfortunately not: I was trying to follow the examples on github but without much success: the example I slightly modified above comes from the official github, but it is some years I don't use gideros and I forgot a lot of the basics, maybe I did something stupid "before" even using imgui looking at what I wrote 4 years ago there is a black hole
anyway I will try to unrust some knowledge, thank you again!
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: keszegh, MoKaLux, pie
Likes: pie
https://github.com/MultiPain/Gideros_ImGui/#minimal-example
PushFont crashes because Begin() wasn't called beforehand
I don't know if it's possible but I would add an error catch to avoid player crashing. It's not critical but it makes it a lot more user friendly. Should I open a github issue? on gideros or Imgui-gideros?
As a side question: I can't draw a gui and avoid continuously rendering(updating) it even if there is nothing happening/nothing clicking it? (an enterframe event is mandatory for imgui to work)?
Coming from a knowledge hole, I feel there might be useful a set of "hello world" examples for imgui because it is really powerful, but at the same time looks overly complicated for someone who is approaching it like a virgin
The demo window, and the project examples are so much feature packed that it feels like going to rocket science when you just need to learn the basic operations
thank you again!
https://github.com/MultiPain/Gideros_examples/tree/master/ImGuiTablesDemo
It is probably a bit outdated, but still very useful
I guess you can use it as a "hello world" example, but instead of "showDemoWindowTables" function call write your own code...
Likes: pie
Likes: keszegh, pie, MoKaLux
https://longtitle-productions.itch.io/fragmenter
Likes: pie, MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Anyway if it is easy to fix it, it would be cool to have access to a working tables example too!
Thank you!
You can remove first line: --!NOEXEC in the TablesDemo file and remove require call, maybe there is an error in TablesDemo.lua, which is why require function fails
Anyway, unfortunately it still breaks on the first lines of TablesDemo.lua (it seems to be a list of macros to me, and even gideros editor displays the same "warning").
Thank you again
ps: I have opened rrraptor's imgui table demo and it works for me with his latest comit.
EDIT to ps : except the very last table example (Sorting) where it crashes the demo (not the gideros player) with this message:
Likes: pie
Like the terminator, they may be back one day
Likes: pie
Likes: MoKaLux
Likes: MoKaLux
I am sorry I've lost track of changes: does this mean that Code dependency settings through project properties is no longer supported? Shall I stick to this method instead?
Since we are already here the demo works but breaks on
TablesDemo.lua:1178: invalid argument #1 to 'colorConvertRGBtoHEX' (number expected, got table)
When I press the "open all" button, or "background color" group
https://github.com/MultiPain/Gideros_ImGui#color-convert
Likes: MoKaLux
As a side question, I noticed that you sometimes refer to ImGui using "ImGui" and sometimes using "ui" which is its instance name. Since every instance of ImGui should be equal to its source object, is there any reason to refer to it as the "parent instance ("imGui")"?
For example in the picture you have just posted I see that row_bg_color uses a method from ImGui, but I believe it could use the same method from ui (as it happens in my file). Am I right?
Thank you, I am sorry for wasting your time
Likes: pie