Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Nuklear-Plugin an immediate mode GUI

Author
Message
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 16th Jun 2020 09:35
Hi, guys,

I was often asked if I could include some Windows controls in my file explorer plugin. I was of the opinion that the effort is too big to make it available to only one system (Windows). So I searched for other possibilities.

Now AGK-Studio uses ImGui for their IDE as far as I know. This is a very powerful GUI interface. I think the latest hints from TGC suggest that they will include it in AppGameKit. The way it sounded only for the STUDIO version. But what I didn't like about ImGui is the fact that it can't use skins. I mean replacing buttons and other controls with images. While searching for other libraries I stumbled upon Nuclear. This is also a so called 'immediate mode graphical user interface' I don't think it's as powerful as 'Dear ImGui' but it's easier to integrate and you can use your own skins. I think this makes sense for AppGameKit. So you can create and use atmospheric skins for games.

The difference between Event-Based-GUI's and the Immediate Mode-GUI's is very big. This required some rethinking for me. It has its pitfalls and certainly its advantages. Because of the architecture of AppGameKit compared to Nuklear, I haven't been able to move all functions from Nuklear to AGK.
I am not ready to provide this plugin yet. But I have already achieved a lot. Here I show you some GIF's, what is possible with it at the moment. The plugin will be available for Windows and Linux for now.

First you can see the style/skinning demo here. The TaharezLook Skin I took from CEGUI. But it was designed by Lars Rinde. Thanks for that . I only added one or two objects.
The skinning properties of Nuklear were kept very basic. I pimped that a bit for AGK. You can change the skinning either in the program or via an XML file. Nuklear only stretched the included images and so the buttons looked a bit distorted. I gave the engine a so-called 9-patch image. That means the images can now be provided with state edges (top, bottom, left, right).



This gif shows what nuclear could look like in the game. I designed the controls myself. Excuse my artistic skills are not that high. Graphically, there is certainly more to be gained.



Finally, I will show you two standard dialog boxes. There are only two at the moment. A MessageBox and a file selector box. Both can be customized with flags. The fileselection box for example is used to select files which can be loaded or saved. But you can also customize it to select folders.



I'd like to know what you think about that. Should I keep at it? Or is it all nonsense since STUDIO provides a GUI anyway. I'm also open for suggestions and ideas.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 16th Jun 2020 10:22
WOW. That is spectacular Mr Bit. Super awesome work
Do you have some code examples for creating/manipulating controls?
When do you think you'll release it?
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 16th Jun 2020 12:23 Edited at: 16th Jun 2020 12:25
Here's a little taste.

It is necessary to create a style. It all works via xml-tags.

there style items are used - checkbox and col_green_transparent - they must be created before.

The checkbox item uses an image (img_checkbox) in this case a 9-patch image. This must also be created first.

This command sets the final style for the ProgressBar. And does not need to be called again.
nk.StyleSetContext("progress")

If I release the plugin I will also do a small style tutorial. But when I release it I can only say - if I have the feeling that it runs smoothly. I might let someone try it as a closed apha test.

The really biggest problem is that I can't deliver/write good documentation. There are now 266 commands without documentation it is hard to handle. However, there is a documentation on the nuclear site where everybody can derive the description of the commands.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 16th Jun 2020 21:48
I just noticed that the above example is not really understandable. Here I show how to create a small demo window. This is the first test run I had done. Without skinning.



This is the result
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Jun 2020 00:12
Cannot wait!
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 17th Jun 2020 08:00
I think a lot of people would love to be able to use this.
Great work!
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 21st Jun 2020 11:49
Hi,

Thank you both.

I have now converted a new demo. With the success that I had to add some functions to the library.
First of all - the pie-menu is not a buildin function. It is written with the plugin in AGK.

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 23rd Jun 2020 05:26
Hi MadBit,
I subscribed to this thread. Excellent work as usual
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 23rd Jun 2020 20:34
Thats pretty smart, I like it, sign me up, when can I preorder?

Does it support menubars and toolbars?

Jack
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 24th Jun 2020 04:58
Awesome GUI.
I really like to customize menus so I really love the possibility in your plugin.

Will it also be possible to create a listview with multiple menu items in it, like images, buttons, text,
something like a server browser for example?:

MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 24th Jun 2020 08:22 Edited at: 24th Jun 2020 08:23
Thank you all.

PartTimeCoder wrote: "Does it support menubars and toolbars?"

Yes of course is also available.

Jack wrote: "Will it also be possible to create a listview with multiple menu items in it, like images, buttons, text,
something like a server browser for example?:"

Something like this should be possible. Such a listbox is not available as buildin function. But you can customize it.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 26th Jun 2020 17:09
I accepted Jack's example as a challenge to rebuild such a listbox.
Just to see how I would implement the listbox with nuklear.

This is what came up.

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 26th Jun 2020 21:24
Very nice MadBit.
Do you have a time plan for public release? You can count on me if you need a tester!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 26th Jun 2020 23:25
me too!
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 27th Jun 2020 08:05
@george++
thanks. I don't have a schedule. When I think it's ready, I'll publish it.

I sent you both (blink0k, george++) a pm.

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
gosukiwi
AGK Tool Maker
3
Years of Service
User Offline
Joined: 24th May 2020
Location: Argentina
Posted: 27th Jun 2020 19:59
@MadBit: Looks awesome!!

It will be great to have this, even if they implement GUI for Studio, this would still work for Classic, so it's totally worth it IMO. And even if they implement GUI for Classic too, alternatives are always welcome!
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 27th Jun 2020 20:21
I have written and tested it for the classic version.
If it works with Studio I don't know. But as long as the Studio version provides the same plugin interface and the standard GLSL shaders work, it should work with it.
I can't test it, because I don't own Studio.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Jack
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 28th Jun 2020 02:55 Edited at: 28th Jun 2020 03:42
Just awesome.

Your example shows the potential of the plugin to display big chunks of organized data.
Great work


I can help you to test on Studio, once you go beta, but I can't imagine any problem.

If you need some simple media generation, add my 2d Shader primitives shaders to your plugin, so the users can generate images for buttons.
I always had them in my GUI systems to replace a lot of media loading/creation with generation. It was very usful to create
buttons of diffrent type. I even created some games based on primitives with it. The coolest part about it is, that it enables two images to be set as main fill and border fill background. All four years, rounded corners on images/ buttons and elements become a thing
If you need some specific reworks, drop me a line. This may be a usful addition to your already great plugin.

shaders found here:
https://forum.thegamecreators.com/thread/214598?page=3

Example Image:

DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 28th Jun 2020 16:07
awesome. Will this be for Windows only? or android /HTML5 support?
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 29th Jun 2020 17:07
@jack
Thanks for your offer / suggestion. But I would have to change too much of the nuclear code that isn't mine. I want to implement the basics first. but thank you.

@DannyD
it's for desktop systems, so Windows and Linux. If I ever get a Mac between my fingers I will put it on it.
As far as I know the AppGameKit player for Android, iOS and Html do not support the plugin interface.

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 30th Jun 2020 14:18
@madbit

Thanks. Let me know if you need testers.

Will this be commercial / Free? Will be interested in this plugin...
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Jul 2020 23:24 Edited at: 11th Jul 2020 23:40
Got some time to test. Running the project Dialog-Dev\MessageBox using Studio
Runs and then disappears.
2020-07-12 08:23:47 nuklear_agk_gl3.cpp(196): ERROR: Failed to setup GLEW!
Log attached

Update
Added #renderer "basic" and it worked. I guess it currently doesn't work with Vulcan


Update
My goodness this is some very slick stuff! Awesome Awesome work!!!

One of the demos

Attachments

Login to view attachments
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 12th Jul 2020 05:12
Thanks for taking the time to look at this.

Quote: "Added #renderer "basic" and it worked. I guess it currently doesn't work with Vulcan"

That is correct. But good to see that it's running under Studio. Even if only limited.

A lot has changed in the last two weeks. Some bug fixes reported by georg++ and I am currently rewriting the styleing system.

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 14th Jul 2020 12:16
Quote: " I am currently rewriting the styleing system.
"

Any news on this progress?
Your project will help me to create the editor I always wanted to build for my games.
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 14th Jul 2020 17:40 Edited at: 14th Jul 2020 17:43
Yeah, I made good progress. I have noticed some design faults that I still have to correct.
They are heavy changes which I partly make. So I have to adapt the demos afterwards.
But I think after the changes some commands and especially the styling are a bit easier and more intuitive.

EDIT:
I am happy when the library is used.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 14th Jul 2020 18:56 Edited at: 14th Jul 2020 18:57
Quote: "I am happy when the library is used."

Your project will be the perfect solution to rebuild my personal tile editor:



I use this editor for a year now, and I have enough experience to know what more features I need, what I should change etc.
I didn't rewrite the editor yet, because the current GUI does not offer what I need. I have to spend time to extend it, but having a solution like yours I can focus to design and data structure
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 18th Jul 2020 09:12
@george++ looks great.

@MadBit so this would not Windows-Only but could be used in any export from AppGameKit than? So we could built HTML, Android and Raspberry Pi tools and apps with that?
Looks very great.
gosukiwi
AGK Tool Maker
3
Years of Service
User Offline
Joined: 24th May 2020
Location: Argentina
Posted: 18th Jul 2020 18:50
It does not work for Android and iOS as they don't support plugins, only Windows, Linux and macOS AFAIK
Jack
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 19th Jul 2020 00:15 Edited at: 19th Jul 2020 00:25
Quote: " I am happy when the library is used."

Iam going to release a bunch to snippets like image codec viewer/ writer.
The problem was always a fast and reliable gui. Without complex interface most of the snippets are hard to use and understand,
aswell as good looking main menus
And consoles to network hubs where multiple protocols are enabled and I have to use multiple programs right now.



I will post some screenshots of my progress once this plugin will be released.

Thank you for your work

DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 20th Jul 2020 03:39
Cant wait to get my hands on this Plugin.. awesome Work MadBit
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Aug 2020 16:18
How well does it scale with different resolutions?
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 4th Aug 2020 17:11
Currently, the virtual resolution must be the same as the selected window resolution. I have solved it so that the plugin automatically adjusts the virtual resolution to the resolution of the window.
I will try to change this. But I can only work on it from next weekend on, because I am on vacation at the moment.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
gosukiwi
AGK Tool Maker
3
Years of Service
User Offline
Joined: 24th May 2020
Location: Argentina
Posted: 5th Aug 2020 22:16
Enjoy your vacation MadBit Also great work so far!

I can't wait till this is more mature. I needed a simple UI for my game but it was complex enough that the provided one is not enough. I think even the default skin looks awesome, reminds me of Steam games like Portal and CS 1.6. I'm totally fine with that style.
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 6th Sep 2020 21:05 Edited at: 6th Sep 2020 21:15
Thanks. My vacation in Austria was great.

So now a small update what I have done since the last post.
The rewriting of the styling commands is finished.

Before: the styling was modified by passing XML tags.



Now I have reproduced the styling context in AGK.
Changing the styles is now hopefully more intuitive.
The example above would look like this.



The output of nuclear widgets scales when the size of the AppGameKit window is changed, as does the AppGameKit output of sprites, objects, images, etc.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 7th Sep 2020 18:47
Quote: "My vacation in Austria was great."

Welcome back MadBit!
What will be the next step? When will we have the chance to test or even better to use it in our projects?
It is the most useful add on of the AppGameKit so far.
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 8th Sep 2020 16:23 Edited at: 8th Sep 2020 16:24
There are still some heavy BUGs that need to be solved, one of them only affects the 64Bit version. I have already found the reason for this bug. Just fixing it is very time consuming. The other bugs are in the core of Nuklear I don't know if I can fix them that easy.
But I will keep you up to date.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Login to post a reply

Server time is: 2024-04-20 13:56:01
Your offset time is: 2024-04-20 13:56:01