Some new helper functions, bug fixes, and debug draw


Emu 2 ended up not really being my main focus since I made that post a little while ago, but I’m still touching it up here and there where I (or other people) think something could use a change.

The biggest addition here is probably the Debug Draw, which lets you see the bounds of elements for debugging purposes. See the attached screenshot for what it looks like. To display it, pass a third argument to any Render methods you call yourself, eg container.Render(x, y, true).

Another method that I’ve been using a lot of myself is EmuList::GetSelectedItem(), which returns the currently-selected item (or undefined) in a list. This saves you from having to write out

var index = list.GetSelection();
var data = array[index];

and allows you do condense that down into

var data = list.GetSelectedItem();

The documentation is starting to get rather out-of-date. I should probably take some time to run through that in the near future.

Changes since 1.1.0

Additions:

  • All Render() methods now accept an option debug_draw argument, which draws a bounding box around each element’s, well, bounding box
  • EmuList::ForEachSelection and ::GetAllSelectedIndices
  • EmuList::FitToBox - allows you to specify a total width and height for the element, without having to predict the size given slot height and slot count
  • EmuList::SetNumbered
  • EmuList::GetSelectedItem - returns the value at the currently selected index, or undefined
  • EmuList::At so you can get the selected entry without mucking around with the entries property
  • EmuInput::SetValueType and ::SetCharacterLimit
  • EmuInput::SetStrictInput - will reject invalid input instead of showing a warning (I usually don’t do this)
  • E_InputTypes.LETTERSDIGITS and LETTERSDIGITSANDUNDERSCORES

Bugs fixed:

  • EmuCore only renders content elements if the element is enabled
  • EmuList::Select will not select a value outside the range of its list
  • EmuInput input can be processed with input elements set to Require Enter

Files

emu-1.2.1.yymps
Jun 10, 2022
EmuDemo.zip 3.6 MB
Jun 10, 2022

Get Emu - UI for GameMaker

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.