Skip to main content

Quick start

To add Headless UI to your game, let's download the latest stable package from the Github releases page.

Open your project in GameMaker Studio, then extract the downloaded zip and drag the file headlessui.yymps onto your GameMaker Studio window.

QuickStart Import Dialog

Press Yes to import the Asset package.

QuickStart Import Dialog

In this window, click Add all and finally you can click Import.


In order to add your first UI component to your game, in the Create event of your controller object, add:

var button = new UiButton(10, 10, 200, 50); 
with (button.state) {
text = "My Button";
on_click = function() {
show_message("Button clicked!");
}
}

In the Step event, add:

ui_step();

And finally in the Draw GUI event, add:

ui_draw();

Congratulations! You have added a full featured button to your game.

Please proceed with the next section to understand how the Components work.