# Canvas tut?

**URL:** <https://forums.unrealengine.com/t/canvas-tut/279864>\
**Category:** UI\
**Tags:** hud, canvas, unreal-engine, menu, CPP, question\
**Created:** [April 7, 2014, 1:07pm UTC](https://forums.unrealengine.com/t/canvas-tut/279864 "2014-04-07T13:07:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![x90\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@x90\_1](https://forums.unrealengine.com/u/x90_1)\
**Post date:** [April 7, 2014, 1:07pm UTC](https://forums.unrealengine.com/t/canvas-tut/279864/1 "2014-04-07T13:07:13Z")

</div>

Looking for documentation on how to roll my own FCanvas for a menu and/or something to take me through building game start menu/level select menu.

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [April 7, 2014, 2:18pm UTC](https://forums.unrealengine.com/t/canvas-tut/279864/2 "2014-04-07T14:18:55Z")

</div>

#800+ Lines of Code, Sample HUD Class Writing to Canvas

I have posted an 800+ line complete sample class, and a VIDEO demoing it here:

[800+ Line Sample HUD Class](https://wiki.unrealengine.com/HUD,_Canvas,_Entire_Class_Sample,_Create_Buttons_%26_Draw_Materials)

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [April 7, 2014, 2:21pm UTC](https://forums.unrealengine.com/t/canvas-tut/279864/3 "2014-04-07T14:21:20Z")

</div>

Canvas is used in HUDs so you need to create HUD first or make menu part of your existing HUD

> **[AHUD](https://docs.unrealengine.com/5.1/en-US/API/Runtime/Engine/GameFramework/AHUD/)**
>
> Base class of the heads-up display.

Canvas is pretty low level drawing mechanism it functions like renderer, you need to call it’s functions in every frame so HUD is drawn on frame currently processed, so if you stop call draw of something durring the cycle, that thing will simply dissapere. So on DrawHUD() or PostRender() of your hud class (which is called when whole frame is rendered and you are sure nothing will be drawn on top of your HUD), you place Canvas calls which will draw the hud, you also need to keep in mind to set settings before setting somehting, like SetTextSize and SetDrawColor and swich between them during drawing. So check the functions they are pretty self explanatory:

> **[UCanvas](https://docs.unrealengine.com/5.1/en-US/API/Runtime/Engine/Engine/UCanvas/)**
>
> A drawing canvas.

To grab clicks you will need HUDHitBoxes

Arternativly you can make Menu if actors by placing them on front for user camera to make menu, or use Slate which is engines UI system which Editor uses… but it not very well documented right now
