# MakeCustomVerts not work.

**URL:** <https://forums.unrealengine.com/t/makecustomverts-not-work/2101109>\
**Category:** UI\
**Tags:** paint, unreal-engine, slate, CPP\
**Created:** [November 2, 2024, 5:50pm UTC](https://forums.unrealengine.com/t/makecustomverts-not-work/2101109 "2024-11-02T17:50:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhaojing](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zhaojing/32/573994_2.png) [@zhaojing](https://forums.unrealengine.com/u/zhaojing)\
**Post date:** [November 2, 2024, 5:50pm UTC](https://forums.unrealengine.com/t/makecustomverts-not-work/2101109/1 "2024-11-02T17:50:15Z")

</div>

my cpp function

```auto
	UFUNCTION(blueprintCallable, Category = "Mybpf")
	static void DrawVtx(UPARAM(ref) FPaintContext& Context,
		FWidgetTransform InTransform,
		USlateBrushAsset* Brush,
		TArray<FVector2f> Vertexs,
		TArray<int> Indexs
		)
	{
		TArray<FSlateVertex> vertexs;
		TArray<SlateIndex> indexs;
		auto RenderTransform = InTransform.ToSlateRenderTransform();
		for (auto vtx : Vertexs)
		{
			vertexs.Add(
			FSlateVertex::Make<ESlateVertexRounding::Disabled>(RenderTransform, vtx, FVector2f(),FColor(1,1,1,1))
				);
		}
		for (auto idx : Indexs)
		{
			indexs.Add(idx);
		}
		
		FSlateResourceHandle handle = FSlateApplication::Get().GetRenderer()->GetResourceHandle(Brush->Brush);
		Context.MaxLayer++;
		FSlateDrawElement::MakeCustomVerts(	Context.OutDrawElements,Context.MaxLayer,handle,vertexs,indexs,nullptr,0,0);
	}

```

my bp

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/2/772f00822337ef7bd8a70afa9426bf53210334de.png)
