> For the complete documentation index, see [llms.txt](https://portalgraphvr.gitbook.io/portalgraph-document-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://portalgraphvr.gitbook.io/portalgraph-document-en/developer-documentation/ui-creation.md).

# UI Creation

This page explains how to display UI in Portalgraph. Portalgraph provides UI that is always displayed at the same size on screen regardless of world scale, renders correctly in left-right and top-bottom split 3D, and supports mouse and touch input.

When displaying UI in Portalgraph, use the following prefabs according to your rendering pipeline instead of a standard Canvas:

* **Built-in** — `Assets/Portalgraph/Prefab/ScreenCanvas`
* **URP** — `Assets/Portalgraph/Prefab/ScreenCanvasURP`
* **HDRP** — `Assets/Portalgraph/Prefab/ScreenCanvasHDRP`

<figure><img src="/files/L7RlgTcWd5KR6aQAbdDc" alt=""><figcaption></figcaption></figure>

After placing the prefab in the scene, set **Portalgraph/Screens/Screen** from the Portalgraph prefab in your scene to the **Screen** field of the **PortalgraphCanvas** component. The UI will then be displayed at full size on that screen.

<figure><img src="/files/717mt3m9p2jOhgb3JDYu" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/1emnLBAvFm61reNnSMGr" alt=""><figcaption></figcaption></figure>

Use **TextMesh Pro** for any text labels. Because this Canvas is in world space, objects in front of it may occlude the labels. To prevent this, set the font asset's shader to **TextMeshPro/Mobile/Distance Field Overlay**.

<figure><img src="/files/g1xUZAhZRRFLhbldBRLL" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/18hDNbP8HzF4c4jOCPka" alt=""><figcaption></figcaption></figure>

Portalgraph UI supports both mouse and touch input. With mouse input, the clickable area is the left half of the screen in left-right split 3D mode, or the top half in top-bottom split 3D mode. With touch input, the entire screen is touchable regardless of 3D mode, and clicks register at the visually correct position.

To switch between mouse and touch input, open the settings screen by pressing **F12** while the Portalgraph application is running, then go to **"Next" → "Input"** and select either **Mouse** or **Touch**.

<figure><img src="/files/A4EfVk5GM3mE5ILAODLm" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://portalgraphvr.gitbook.io/portalgraph-document-en/developer-documentation/ui-creation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
