Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

AutoUi for GameMaker

A UI system for GameMaker for responsive, dynamic interfaces in seconds · By ome6a1717

AutoUi Update v1.1.0 Sticky

A topic by ome6a1717 created 76 days ago Views: 76 Replies: 5
Viewing posts 1 to 2
Developer

Quite a huge new update for AutoUi!  I'm personally very excited about this one, as there are tons of life improvements and new features.

NEW ELEMENTS


  • auto_button
    • A simple sprite with text aligned to the center/left/right 
    • Includes built-in mouse functionality and index changing for checked, unchecked, highlight, etc. similar to the checkbox    
  • auto_row
    • A row which arranges child element arrays into left, center, and right sections with custom padding and spacing.
    • (NOTE: ONLY fits inside v_containers)

NEW FEATURES

  • '.add_watcher(_obj, _var_name, _func_call, [_func_params])' available to all elements
    • Similar to signals, watchers check an obj/struct variable for a change, and if that change is found
    • it calls the user function set using add_watcher()
    label.add_watcher(o_player, "hp", function(_new_value, _maxhp, _color) { 
        set_text(string_concat(_new_value, "/", _maxhp); 
        color = _color             
    }, [maxhp, c_red]);

  • Added o_07_watchers example object
  • Added o_08_rows example object


UPDATES    

  • All constructor user methods (ie on_click_func, on_hovering_func, on_value_changed_func etc.) now have an additional <>_args variable
    • They also have their own creation methods (eg. <element>.set_click(_func, _args), <element>.set_on_hovering(_func, _args), etc.)
label.set_click(function(_a, _b){ _a.variable = _b; }, my_a_var, my_b_var]);

  

  • New container methods 'get_hpadding' / 'get_vpadding'
  • New '.add(_element)' method for auto_containers that take either an element or array of elements
  • New '.set_sprite(_sprite,[_index=0])' method for auto_image
  • New '.align_right', '.align_center', '.align_bottom', etc. methods for ALL elements
  • New '.set_max_segments' for Segmented Lifebar
  • Added 'uvals' variable that references user_values (shorthand for easier code legibility)    
  • 'play_one_shot_animation()' is now available on every element instead of just containers
  • Added additional helper methods for images and scrollers (mainly for v/h alignment; auto_image_right(), auto_image_bottom(), etc.)
  • INTERNAL: Signals and watchers are now calculated BEFORE the step() method of each element is called


ALTERING CHANGES

  • Added a +1px y offset to labels that are either vertically centered in a h_container, or in a v_container
  • IMPORTANT signals no longer allow function calls
    • If you're using them , just change ".connect_signal_<>" with add_watcher() (see above in new features)

BUG FIXES

  • Default value of separation on auto_label helpers is now set to 8 (was 9999999999...?)
  • auto_lifebar's initial value was defaulted to 100; is now undefined (which will just set it to max)
  • Checkboxes now no longer alter sprite color if text color is changed
  • Default value for lifebar is now undefined which will set it to your max value if not set
  • Image set_sprite_settings method had a wrong function call
  • Calculation of aui_get_gui_x/y was incorrect - should fix any hovering issues.
  • 'show_debug_outline' set to true now highlights white if hovering

When adding this to my project I cant seem to get the hover functions or on click functions to work. even if I copy one of the examples from your example projects

Developer (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.  

okay seems the xtend resolution manager is causing some issues :( anytime I use The GUI draw events

Oops didnt see your edits changing the get_gui methods worked like a charm 10/10 service even at 2:30 am lol

Developer

:)