Asset - Scripts ZekUI - Windows-like GUI Framework

Zek

Member


GameMaker: Marketplace
Price: $4.99
Platforms: Only tested on Windows, but should work on most other ones (Except HTML5).


ZekUI is a feature-rich GUI framework for GameMaker: Studio designed to make Windows-like tools and applications.

The framework uses surfaces to only redraw widgets that actually needs to be updated, instead of redrawing the widgets every frame. This makes it very optimized and thus runs at a high performance!
Every widget can be customized by changing the sprites, colors and more!
The extension comes with a basic example project that shows you how to use the framework.


Click here to download an example program.

ZekUI let's you create:

  • Windows
  • Frames
  • Menustrips
  • Dropdown Menus
  • Buttons
  • Input Boxes
  • Tree Views
  • List Boxes
  • Scrollbars
  • Sliders
  • Tab Controls
  • Checkboxes
  • Radio Boxes
  • Progress Bars
  • Labels
  • Panels
  • Images

Note: This framework is only intended to be used in applications and tools, not games.

There isn't a whole lot of documentation yet as I don't the time to write it at the moment, but if you need help or have any questions feel free to ask me here or contact me at zekronzgames@gmail.com.

Update 1.0.2
  • Fixed a bug when trying to paste text into an inputbox after setting the max length using ZekUI_inputbox_set_max_length.
Update 1.0.1
  • You can know center a window using ZekUI_window_center(window_id);
  • Fixed some bugs regarding list boxes.
 
Last edited:

GMWolf

aka fel666
Overall, looks rather good! Great job.

The framework uses surfaces to only redraw widgets that actually needs to be updated, instead of redrawing the widgets every frame
This concerns me a little: what is the impact on memory usage, and page swaps?
Does it scale well when you have hundreds of widgets?
 
  • Like
Reactions: Zek

Zek

Member
This concerns me a little: what is the impact on memory usage, and page swaps?
Does it scale well when you have hundreds of widgets?
The memory usage should be fine because I only have one main surface that all the widgets get drawn to if they are not on a window, and then one surface for every window.
 

GMWolf

aka fel666
The memory usage should be fine because I only have one main surface that all the widgets get drawn to if they are not on a window, and then one surface for every window.
Oh cool. I thought it was one per widget.
Defo will be considering it.
 
  • Like
Reactions: Zek

Zek

Member
Do you perhaps have some example code snippet?
Sure!

Code:
//Creates a window at 64, 64 with the size of 256, 256, and sets the title to "Example Window"
window = ZekUI_window_create(64, 64, 256, 256);
ZekUI_window_set_title(window, "Example Window");

//Creates a button on the window at 16, 16 with the size of 128, 24 and the text "Button"
button = ZekUI_button_create(window, 16, 16, 128, 24, "Button");
Let me know if there's anything specific you want to know.
 

cgPixel

Member
Bought it, this is exactly what I've needed!
There is only one thing (besides a real documentation) that would improve this asset alot: dropdown submenus.

How can I handle events of dropdown menus?
(e.g.: If a user clicks on "Exit")

Keep up the good work!
 

Zek

Member
Bought it, this is exactly what I've needed!
There is only one thing (besides a real documentation) that would improve this asset alot: dropdown submenus.

How can I handle events of dropdown menus?
(e.g.: If a user clicks on "Exit")

Keep up the good work!
Thank you for the feedback!
You can use ZekUI_menu_item_set_callback(menu_id, item_id, action) to add callbacks to dropdown menus, where action is the script that gets called when you click on an item.
 

Zek

Member
I have one suggestion: Greyed-out text fields.
Are you working on a documentation for this extension?
I don't really have a lot of time to write the documentation at the moment, but it's definitely something I want to get done.
 

cgPixel

Member
Found a bug, if I use ZekUI_inputbox_set_max_length and try to copy paste a text from my clipboard in the inputbox, this error appears:
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object obj_ZekUI_inputbox:

local variable text(100001, -2147483648) not set before reading it.
at gml_Script___ZekUI_inputbox_paste_text (line 3) - if(clipboard_has_text() && (max_length < 0 || (max_length >= 0 && string_length(text) < max_length))){
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script___ZekUI_inputbox_paste_text (line 3)
called from - gml_Object_obj_ZekUI_inputbox_StepNormalEvent_1 (line 1063) - if(__ZekUI_inputbox_paste_text(input_cursor_pos)){
Changed nothing, fresh import in 1.4.1788 and 1.4.9999.
 

Zek

Member
Found a bug, if I use ZekUI_inputbox_set_max_length and try to copy paste a text from my clipboard in the inputbox, this error appears:
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object obj_ZekUI_inputbox:

local variable text(100001, -2147483648) not set before reading it.
at gml_Script___ZekUI_inputbox_paste_text (line 3) - if(clipboard_has_text() && (max_length < 0 || (max_length >= 0 && string_length(text) < max_length))){
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script___ZekUI_inputbox_paste_text (line 3)
called from - gml_Object_obj_ZekUI_inputbox_StepNormalEvent_1 (line 1063) - if(__ZekUI_inputbox_paste_text(input_cursor_pos)){
Changed nothing, fresh import in 1.4.1788 and 1.4.9999.
The error has been fixed and will be updated soon!
 

cgPixel

Member
Great, thank you!

If anyone needs an extension for WinAPI like controls, you'll definitely have to get your hands on this ;)
I highy recommend this extension!

Best Regards
 
  • Like
Reactions: Zek

viliti

Member
Hello!
This is a great tool and I have used it in couple of my little apps.

I'm just wondering, is there an easy way to make a input box multiline?
 

Zek

Member
Hello!
This is a great tool and I have used it in couple of my little apps.

I'm just wondering, is there an easy way to make a input box multiline?
Hi, thank you for the feedback!
Unfortunately, it currently does not support multi-line input boxes.
 

Samuel Venable

Time Killer
Cool idea that just occurred to me; if it doesn't have this already, you could have a way to toggle on/off dpi awareness. Native GUI frameworks have dpi awareness, and this would give the illusion of being dpi aware if you scaled the window, fonts, and controls relative to the user's current system dpi settings.

Code:
dpi_xscale = (display_get_dpi_x() / 96)
dpi_yscale = (display_get_dpi_y() / 96)
 

IGameArt

Member
I'm having a strange issue with listboxes not drawing their contents. I can still interact with them, but I can't see anything inside them. All other elements work perfectly, except for the list box on the right, it has several entries but I can't see them :\

 

Zek

Member
I'm having a strange issue with listboxes not drawing their contents. I can still interact with them, but I can't see anything inside them. All other elements work perfectly, except for the list box on the right, it has several entries but I can't see them :\
That's very strange! I've never experienced anything like that. Did you change anything that might have caused it? (Except for the styling of the widgets) Are you using the latest version?
 

IGameArt

Member
I compared against a github commit from earlier in the day and couldn't find any change that would have caused that. I did end up coming up with a solution however, by applying a draw_clear(c_black) to the item surface of the listbox before it began drawing items to it and that suddenly made the surface visible again without any odd side effects, which in and of itself is a little odd.
 

Zek

Member
I compared against a github commit from earlier in the day and couldn't find any change that would have caused that. I did end up coming up with a solution however, by applying a draw_clear(c_black) to the item surface of the listbox before it began drawing items to it and that suddenly made the surface visible again without any odd side effects, which in and of itself is a little odd.
Hmm... I'll see if I can find any issues and let you know. I'm glad you got it working though!
 

IGameArt

Member
I ended up running into another issue but I'm sure this time it's probably just my own fault.



Inside the tab_frame I've created another frame called orgFrame, this frame is set to be the same size as the tab_frame, minus some padding around the edges.
The variable orgFrameH denotes where the height of all of the contents inside of this frame.

I've set up the scrollbar code as follows:
Code:
orgBar = ZekUI_scrollbar_create( tab_frame, ZekUI_frame_get_x(orgFrame) + ZekUI_frame_get_width(orgFrame), 0, ZekUI_frame_get_height(orgFrame), 1);
ZekUI_scrollbar_set_max_value(orgBar, orgFrameH - ZekUI_frame_get_height(orgFrame));
ZekUI_scrollbar_set_round_value(orgBar, true);
Am I doing something inherently wrong?

EDIT: Yes, it was my fault. I assumed that it would automatically adjust the position of everything in the frame, but I was incorrect in my assumption.
 
Last edited:
Top