# 🪟 UI

Nuake’s UI system is heavily inspired by today’s modern web frameworks. In fact, the layout system is the same as any web standard. It’s layout is defined in `.html` files and the styling in `.css` stylesheets.

## Layout

The syntax for the layout files are a bit different than regular web files. If we look at the following snippet we can notice a couple differences:

```markup
<div class="root" stylesheet="test.css">
    <div class="panel">
       <text class="text">Welcome to Nuake Engine</text>
       <text class="text">This is a demo project showcasing</text>
       <text class="text2">Nuake UI!</text>
    </div>

    <div class="panel">
        <text class="note">This is a a WIP</text>
     </div>
</div>
```

First, we don’t need to define a header, or a body. Everything, in this file is the body itself. We can define which stylesheet is going to be used to style this piece of UI by using the `stylesheet` attribute on the top-most node.

We don’t have to deal with different header sizing. Everything that display text is a `text` node.

## Styling

The stylesheet files are also a bit different than regular `css`. With added styling options and renamed one to make more sense in the sense of a game.

```scss
.root {
    width: 100%;
    height: 100%;
    display:flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.panel {
    margin-left: 16px;
    margin-right: 16px;
    margin-top: 16px;
    padding-left: 16px;
    padding-top: 16px;
    padding-right: 16px;
    padding-bottom: 16px;
}

.text {
    font-size: 64px;
    text-align: center;
}

.text2{
    font-size: 22px;
    color: #ff1100;
}

.note {
    font-size: 24px;
    text-align: center;
}
```

## UI Component

We can then add a new `UI Component` to any entity in our scene, and drag the *layout* file in the `HTML File` property. The UI should appear immediately and every time you make a change to your `html` file, the UI should reload automatically.

 ![Output of the previous UI](https://docs.antopilo.dev/api/files.get?sig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJ1cGxvYWRzL2FlOGRmOTVjLWZlZTktNGRmNy1hZjVlLTBkNTJkYjg4MmJjZC80ZjBiNzY2MC00ZmNmLTRhNWEtYTQyOC1jNTExZTI0M2I4MzcvaW1hZ2UucG5nIiwidHlwZSI6ImF0dGFjaG1lbnQiLCJpYXQiOjE3OTYzMDEwMDAsImV4cCI6MTc5NjM4NzQwMH0.siQ_YTuQHA3w7aFB6JJxvuqYNw0M0rYLMJXaBdsNUEc " =2646x1127")

---

**Documents**

- [Project Status](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/project-status-6fyDviuXlE)
- [Welcome](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/welcome-yF3kGz8XH3)
- [Workflow](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/workflow-S9ota9vgbD)
- [Scene](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/scene-HdnkvdILFd)
- [Scripting](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/scripting-LI3IE46tt2)
- [UI](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/ui-ZW3OQfS29Z)
- [Debugging](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/debugging-UmswlxDLyv)
- [Modules](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/modules-h26DveHarI)