Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

ome6a1717

73
Posts
9
Topics
316
Followers
1
Following
A member registered May 30, 2020 · View creator page →

Creator of

Recent community posts

Thank you!

AutoUi Update v1.3.1

UPDATES

  • (auto_textedit) now allows you set the helper text alignment using set_helper_text()

BUG FIXES

  • (auto_label) set_force_text_wrap's _separation value is now defaulted to undefined instead of 14

Thank you!

Thank you!

That’s correct, each room can be entered from any adjacent room. 

Currently, yes - this is as far as I'm developing for the time being!

Of course!

I've found scope to be very difficult to figure out in GML when using script_execute, to be honest.  For instance, what you did will work fine for windows/macos export, but if you export to HTML5, it will sometimes throw an error that it is unable to find your element.


It's generally just best practice to pass in all objects you use or reference for safety:

my_button = auto_button(/* data */);
my_button.set_click_func(function(_obj, _btn) {
    _btn.color = c_white; // eg.
    _obj.variable = 2; // eg.
}, [self, my_button]);

Are you calling instance destroy in set_click_func?  If so, generally the scope will be the element and not the base object, so you’ll have to pass in the obj_autoGUImenu id as a parameter and destroy that. 

CHANGES TO BE AWARE OF

  • The grouping of the script/notes/examples are now in Tools > AutoUi instead of their respective Scripts/Notes/Etc. folders

NEW ELEMENTS

  • New ELEMENT: (auto_nine_slice) - a simple nine-slice sprite that flexes it's w/h to the parent container

UPDATES

  • (auto_lifebar) - set_value() now has an optional added parameter, _instant (instantly sets the value instead of lerping)
  • (auto_label) - now has an optional index frame for nine_slice_background (set using set_nine_slice_frame())
  • .set_visible() sets hovering to false on call (if you were hovering and called set visible, it would keep true indefinitely)

BUG FIXES

  • Minor bug fixes
  • Stack's set_visible() now correctly affects all children
  • Auto-complete will now provide all of the variables and methods for each element

Well, this made me investigate further and realize that I CAN have auto-complete populated, so I'll push that in the next update which should be coming out shortly!

Totally understand.

Currently, the easiest would be the Notes > AutoUi Documentation folder.  I can't promise they are 100% updated as of the current version, though.  In your opinion, what would be the best format (other than obviously autocomplete)?  

Of course!


You can find the methods in the respective script file of each element (eg. auto_button's methods are in the AutoUiButton script file.)  They are definitely worth a look through, especially since depending on which code editor you're using, autocomplete can be quite finicky.

Really glad you're finding it useful, and thanks so much for the kind words!

I thought about doing a video regarding this since I had to figure it out in my recent game, but for now here is the method I used:

1. Create a 'select' index variable, radiogroup, and function in your object that creates the "structure" of your selection (in the create event):

radiogroup = auto_radiogroup();
select = 0; // the index currently selected
options = []; // we'll add this later
menu_option = function(_name) {
    var _btn = auto_button_checkable_center(120, 40, _name, font, bgsprite, false, radiogroup);
    return _btn;
};

2. Add all of your options

options[0] = menu_option("Start");
options[1] = menu_option("Load");
options[2] = menu_option("Quit");
// add to your main container

3. Then in the step event:

if control_is_pressed("down") {
    select = (select+1) mod array_length(options); // set to next index
    options[select].set_checked(true, true); // checks this button and unchecks the rest of the radiogroup
}
if control_is_pressed("up") {
    select = (select+array_length(options)-1) mod array_length(options);
    options[select].set_checked(true, true); // checks this button and unchecks the rest of the radiogroup
}
if control_is_pressed("select") {
    switch(select) {
        case 0: startgame(); break;
        case 1: loadgame(); break;
        case 2: game_end(); break;
    }
}

Obviously this is a relatively rudimentary version of this, but again - I might do a video going into further detail.

Now, if you're like me and need to display more than just a button (eg. you want to have the "container" selectable), for now, you can kind of hack this by using a button as the background (with text set to ""), and place that and all of your elements in a stack.

Hopefully that should point you in the right direction!

I imagine it will continue to hold that record for you :)

Thank you!  And glad you enjoyed it :)

(1 edit)

Thank you so much!

While it doesn't explicitly support gamepad, there are many ways you can do it:

--- CREATE EVENT ---

index = 0; // your current selected index 
c = auto_container_v(80, 8); // width/spacing 
radiogroup = auto_radiogroup();  
/// @desc Returns a struct of a new button element, index, and select function 
new_button = function(_text, _index, _select_func) {     
    // Create the button     
    var _btn = auto_button_checkable_center(80, 32, _text, FONTS.px_6x6, s_tt_btn_purple, _index == 0, radiogroup);
    // Set the hovering function, passing in this object and the index         
    _btn.set_hovering_func(function(_obj, _index) {             
    // Set this button to be "checked", and uncheck all other buttons in the radio group             
        set_checked(true, true);             
        _obj.index = _index; // set the obj's index correctly         
    }, [self, _index]);         
    // Assign the click function         
    _btn.set_click_func(function(_select_func) {             
        _select_func();         
    }, [_select_func]);     
    // Returning a struct of the button, index and select function     
    return {         
        button: _btn,         
        index: _index,         
        select: _select_func     
    } 
}  
// Here is our struct data where we create our buttons 
button_data = [     
    new_button("New Game", 0, function() { show_debug_message("START NEW GAME"); }),         
    new_button("Load Game", 1, function() { show_debug_message("LOAD GAME"); }),         
    new_button("Quit Game", 2, function() { game_end(); }) 
]  
// And don't forget to add the button to the main container 
for (var i = 0; i < array_length(button_data); i++) { c.add(button_data[i].button); }

--- STEP EVENT ---

c.step(5, 5);  
// EZ check if you press up or down (uses AutoInput; replace with gamepad_button_check etc.) 
var _ydir = control_is_pressed("menu_down", 0) - control_is_pressed("menu_up", 0);  
// If a button was pressed... 
if _ydir != 0 {     
    // Set the index     
    index = (index + array_length(button_data) + _ydir) mod array_length(button_data);     
    // And make sure to set checked to true     
    button_data[index].button.set_checked(true, true); 
}  
// If select, run function 
if control_is_pressed("menu_select", 0) { button_data[index].select(); }

And then run c.draw() in your draw event!  Now it handles BOTH mouse and gamepad.


Hopefully that helps - it's not quite as cut and dry, but because some people have their own input systems (eg. AutoTools' AutoInput!), I didn't want to put too much of that in AutoUi.

I'll probably add this to an example in the package, though - thanks for the suggestion!

Thank you!

Thank you!

Thank you both - this has now been fixed! :)

Do you mean the titles or the descriptions?

Ah!  Good catch on the bug - I'll have to fix that...glad you enjoyed!

That's great to hear!  Glad you enjoyed it.

Thank you!

That's interesting - it's about as optimized as you can get for something like this.  That being said, I know HTML5 has its limits.  There is also a windows executable you can download that should play better.

Thank you!  You should be able to play without needing to log into itch. 

Thank you!

Thank you!  I'll investigate that - I appreciate it.

UPDATES

  • New setter methods for AutoUiStack (align_elements_<left, right, center, top, bottom, top_left, top_right, bottom_left, and bottom_right>)
  • New Stack example object
  • New helpers methods for AutoUiStack (auto_stack_<placement>)

BUG FIXES

  • Had a wrong method in AutoUiRow (len() instead of array_length())
  • get_offset_y now returns the correct offset value
  • The method for determining if the scroller's scrollbar visibility had the wrong bool check calculation
  • TextEdit paste function no longer adds wrong edit index

Thank you so much!  Truthfully I wanted something fun and nice to listen to, and didn’t really feel like writing something myself :)

It an evolution that shoots projectiles at the nearest enemy from your mouse position

Some small bug fixes:

UPDATES

  • New helper methods for container (auto_container_h_zero, auto_container_v_zero) for zero padding
  • (auto_button) set_checked now has an optional "uncheck_radio_group_buttons" parameter defaulted to false
  • (auto_button) New Method: '.uncheck_radio_group()'
  • (auto_lifebar) New Methods: 'set_width()' and 'set_height()'

BUG FIXES    

  • Fixed error in auto_button_checkable_sprite() method
  • Fixed mouse positioning again...(aui_get_gui_x/y)

:)

(2 edits)

I think that's due to my get_gui methods...It's fixed in the next update which isn't released just yet, but you can copy the fix here and paste it in for now:

function aui_get_gui_x(_x) {      
    return window_mouse_get_x()/window_get_width() * display_get_gui_width();      
}  
function aui_get_gui_y(_y) {      
    return window_mouse_get_y()/window_get_height() * display_get_gui_height();      
}


Copy that code and paste it into AutoUiShortcuts (the functions should be at line 112 - just replace them)


If that doesn't work...do you have any camera resizing in your game?  You can also try setting the <element>.hover_type = AuiHoverType.DRAW or DRAW_GUI and see if that fixes it.  

Thanks for playing!

Thank you!

Thank you!  To be honest, I don't think it would be too difficult porting to macOS (he said, foolishly...)  But thank you for the suggestion - I'll definitely investigate it!

Thank you so much!  I checked out your game - it’s pretty cool.  I really like the art style.

Thank you!