Worm | Building the interface with graphics and buttons.

  1. In the assets panel, right click the 'main' folder and select, 'New...', 'Gui'.

New GUI

  1. Name the Gui, 'title' to match the collection it will belong to and click, 'Create Gui'
  2. In the outline panel, right click, 'Textures' and select, 'Add', 'Textures...'.

Add Textures

Textures are graphics that will be used on our GUI.

  1. Select, '/main/graphics.atlas' and click, 'OK'.
  2. In the outline panel, right click 'Nodes' and select, 'Add', 'Box'.

Add box

A node is an object on the Gui. A box is usually a button, but we can also use it for graphics such as titles.

  1. Change the Id of the box to be, 'title'.
  2. Change the 'Position' properties to be X: 480 and Y: 480.
  3. Change the 'Texture' property to be, 'graphics/title'.
  4. Repeat steps 5 to 8 to create four buttons as shown below. Move the buttons underneath the title using the editor tools and make sure the buttons have their 'Id' property set to:
    • 1up, 2up, 3up and 4up.

Title Gui

Gui outline and properties

  1. Attach the title.gui file to the title.collection file by creating a game object in that collection called, 'gui. Add the component file, 'title.gui'.
    Step-by-step guide
    • In the assets panel, in the 'main' folder, double click, 'title.collection'.
    • In the outline panel, right click, 'Collection' and select, 'Add Game Object'.
    • In the properties panel, change the 'Id' property to, 'gui'.
    • In the outline panel, right click, 'gui' and select, 'Add Component File'.
    • Select, '/main/title.gui' and click, 'OK'.
  1. Save the changes by pressing CTRL-S or 'File', 'Save All'.
  2. Run the program by pressing F5 or choosing, 'Debug', 'Start / Attach' from the menu bar. You should see the interface you have just created.
    Run

The buttons don't do anything yet because we haven't scripted them. That's the next stage. Stage 2c >