# How can I draw a filled triangle in Slate?

**URL:** <https://forums.unrealengine.com/t/how-can-i-draw-a-filled-triangle-in-slate/279959>\
**Category:** UI\
**Tags:** draw, unreal-engine, slate, question\
**Created:** [April 8, 2014, 9:53am UTC](https://forums.unrealengine.com/t/how-can-i-draw-a-filled-triangle-in-slate/279959 "2014-04-08T09:53:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_cebf9e9e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_cebf9e9e](https://forums.unrealengine.com/u/anonymous_user_cebf9e9e)\
**Post date:** [April 8, 2014, 9:53am UTC](https://forums.unrealengine.com/t/how-can-i-draw-a-filled-triangle-in-slate/279959/1 "2014-04-08T09:53:06Z")

</div>

I need to draw a filled triangle in the HUD. How can I do this without using a FSlateBrush?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d44e7f33](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d44e7f33](https://forums.unrealengine.com/u/anonymous_user_d44e7f33)\
**Post date:** [April 8, 2014, 10:46am UTC](https://forums.unrealengine.com/t/how-can-i-draw-a-filled-triangle-in-slate/279959/2 "2014-04-08T10:46:56Z")

</div>

I don’t think that’s really a Slate thing (I haven’t seen anything that even suggested primitive shapes, it’s not really that kind of system…), sounds like something you’d do with canvas in the HUD class itself. Getting the HUD stuff to talk to your Slate stuff shouldn’t be too hard.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_cebf9e9e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_cebf9e9e](https://forums.unrealengine.com/u/anonymous_user_cebf9e9e)\
**Post date:** [April 8, 2014, 11:25am UTC](https://forums.unrealengine.com/t/how-can-i-draw-a-filled-triangle-in-slate/279959/3 "2014-04-08T11:25:35Z")

</div>

It’s working. Thank you very much.

---

<div class="post-metadata">

**Author:** ![szyszek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@szyszek](https://forums.unrealengine.com/u/szyszek)\
**Post date:** [April 8, 2014, 1:06pm UTC](https://forums.unrealengine.com/t/how-can-i-draw-a-filled-triangle-in-slate/279959/4 "2014-04-08T13:06:48Z")

</div>

Just to clarify, you can use Slate to draw any kind of primitive geometry by overriding `OnPaint` function inside your custom widget and using `FSlateDrawElement::Make*()` method to draw whatever you want.

\* can be “Box”, “Line”, “Text” etc… So if you want your widget to be displayed as a box you would do something like that:

```
int32 SMyCustomWidget::OnPaint( ARGS_HERE) const
{
FSlateDrawElement::MakeBox( ARGS_HERE );
}

```

to draw triangle you would use `FSlateDrawElement::MakeCustom()` and pass points as parameters. So as you can see its definitely possible to draw primitives in Slate but its easier to make it in Canvas.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_cebf9e9e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_cebf9e9e](https://forums.unrealengine.com/u/anonymous_user_cebf9e9e)\
**Post date:** [April 8, 2014, 5:03pm UTC](https://forums.unrealengine.com/t/how-can-i-draw-a-filled-triangle-in-slate/279959/5 "2014-04-08T17:03:38Z")

</div>

I think the use of ICustomSlateElement primitives correctly in this situation. Thank you.

---

<div class="post-metadata">

**Author:** ![mihxen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mihxen](https://forums.unrealengine.com/u/mihxen)\
**Post date:** [September 4, 2025, 1:28pm UTC](https://forums.unrealengine.com/t/how-can-i-draw-a-filled-triangle-in-slate/279959/6 "2025-09-04T13:28:23Z")

</div>

If you still need it or someone else looks for a solution over years:

static void PaintTriangle(  
const FVector2D& P0,  
const FVector2D& P1,  
const FVector2D& P2,  
const FGeometry& AllottedGeometry,  
FLinearColor Color,  
const FSlateBrush\* Brush,  
FSlateWindowElementList& OutDrawElements,  
int32 DrawLayerId)

from Engine\Source\Editor\Persona\Private\SAnimationBlendSpaceGridWidget.cpp perfectly fits your (and my) request
