Skip to content

0.6.7

Latest

Choose a tag to compare

@shdwcat shdwcat released this 06 Apr 19:16

⚠ NOTE: Required GM Version is now 2024.11 ⚠

⚠ Breaking change (minor) ⚠

  • the previous switcher.yui widget has been renamed to scoped_switcher.yui. The new switcher.yui does not require a selection_scope in order to function (check the Widget Gallery in the example project for how to use it) #95

Primary Improvements

New front page for the example project!

And updated binaries for it in in this release (see below)

You can now use double quotes inside YUI expressions:

For example. text: @name + " name". Note that the normal expression rules still apply, e.g. text: "Name " + @name is not a valid expression, you would need to do: text: @@ "Name " + @name

YUI color constants now support all GM colors and all standard Web colors

GM colors are specified as in GML, e.g. background: c_red. Web color names can be used directly, e.g. color: goldenrod. Additionally, casing on color constants is ignored, so Red and red are both valid.

#36 Implement system for easily adding YUI elements that draw for GM game objects

New object_attachment element that you can use like any other element, though you'll probably want to use it in a panel. For example:

    // enemy status bars
    - type: panel
      elements: @enemies
      template:
        type: object_attachment
        target: @
        placement: bottom_center
        content:
          type: panel
          // status bar UI goes here

In this example, @Enemies is an array of e.g. obj_enemy game objects. The panel will create an object_attachment element for each enemy. target specifies which game object the attachment should use for its position. placement tells it where to arrange the UI relative to the target (and uses the same values supported by tooltip_placement). content is the UI to draw at that position.

#102 Allow specifying sprites for click and hover events for a button

button (or border/panel/etc) background can now by specified like this:

      type: button
      padding: [10, 10]
      background:
        type: check_element_state
        pressed: ~spr_start_page_button_pressed
        hover: ~spr_start_page_button_hover
        focused: ~spr_start_page_button_hover
        normal: ~spr_start_page_button_default // note: background colors are also allowed

Note that a button can be in multiple of these states; the order the checks are evaluated in is pressed -> hover -> focused -> normal. If e.g. hover value is not specified, it will use the next state that is. Currently this feature only applies to background, but if it would be useful on other properties please open an issue for those!

image now allows rendering YUI content as a sprite

YUI can be a convenient layout tool for drawing complex static images from parts like sprites/text/etc. An example might be rendering a card for a deckbuilder. This functionality allows you to create a sprite at runtime from some YUI content, and display that within other YUI content as an image.
NOTE: none of YUI's dynamic behavior like tooltips or button highlighting will work in the image! Sprite animations are not supported either, but will likely be supported in a future version
NOTE: runtime sprites should be cleaned up when no longer used. You can call .destroy() on the sprite cache to delete all sprites tracked in the cache
Example

      type: image
      sprite_cache: @sprite_cache // this must be a YuiSpriteCache 
      sprite_cache_id: @cache_id // this is the ID for this generated sprite in the cache
      sprite_builder:
        type: sprite_builder
        content:
          type: border
          // put your content here

Bug Fixes

YUI assets will no longer be stripped when 'Strip unused assets' is enabled.

These are now referenced in __yui_asset_references to prevent the compiler from stripping them

#85 Texts with scribble set to true don't work properly with scrollboxes.

Fixed by using the new gpu scissor functions in 2024.8

And many more...

  • Mac should now work regardless of whether file sandbox is enabled or disabled
  • grid layout behavior improved
  • fixed various bugs related to xoffset/yoffset
  • etc

Full Changelog: 0.6.4...0.6.5