Skip to content

Commit 39ed6dc

Browse files
authored
Documentation: Add guide on how to add UI canvas (#40)
1 parent f25446f commit 39ed6dc

9 files changed

Lines changed: 46 additions & 1 deletion

File tree

content/docs/world/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"title": "World",
33
"icon": "Globe",
4-
"pages": ["index", "setup", "building", "testing", "props"]
4+
"pages": ["index", "setup", "building", "testing", "props", "ui-canvas"]
55
}

content/docs/world/ui-canvas.mdx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: Canvas UI
3+
---
4+
5+
import { Callout } from 'fumadocs-ui/components/callout';
6+
7+
## How to Add a Canvas
8+
9+
- Add a canvas to the scene hierarchy and give it a suitable name.
10+
11+
![BasisFramework UI canvas context window](/img/ui-canvas/1.png)
12+
13+
<Callout type="info">
14+
Note: If you are making a World Space canvas, an X,Y,Z a scale of 0.001 is usually a good starting value.
15+
</Callout>
16+
17+
- Remove the Graphic Raycaster component if it is present. Basis provides its own graphics raycaster.
18+
19+
![BasisFramework UI canvas remove graphic raycaster](/img/ui-canvas/2.png)
20+
21+
- Add a Basis Graphics UI Ray Caster component and attach your canvas object to its Canvas field in the inspector.
22+
23+
![BasisFramework UI canvas add Basis Graphic Raycaster](/img/ui-canvas/3.png)
24+
25+
- Add a Basis UI Component, making sure to assign the required fields in the inspector.
26+
27+
![BasisFramework UI canvas add Basis UI Component](/img/ui-canvas/4.png)
28+
29+
![BasisFramework UI canvas add Basis UI Component required fields](/img/ui-canvas/5.png)
30+
31+
- Change the canvas layer to OverlayUI.
32+
33+
![BasisFramework UI canvas layer OverlayUI](/img/ui-canvas/6.png)
34+
35+
<Callout type="info">
36+
Ensure that there are no EventSystem objects in your scene, otherwise any UI items added to your canvas will not be able to be interacted with.
37+
</Callout>
38+
39+
Below is an example image of a canvas containing a panel, toggle, button, dropdown, slider and input field.
40+
41+
![BasisFramework UI canvas layer OverlayUI](/img/ui-canvas/7.png)
42+
43+
<Callout type="info">
44+
Note: When looking at a UI item, your raycast pointer or cursor turns into a blue circle.
45+
</Callout>

public/img/ui-canvas/1.png

45 KB
Loading

public/img/ui-canvas/2.png

71.4 KB
Loading

public/img/ui-canvas/3.png

11.4 KB
Loading

public/img/ui-canvas/4.png

6.93 KB
Loading

public/img/ui-canvas/5.png

17.5 KB
Loading

public/img/ui-canvas/6.png

85.1 KB
Loading

public/img/ui-canvas/7.png

82.9 KB
Loading

0 commit comments

Comments
 (0)