# It is possible to draw 2D line in edit mode

**URL:** <https://forums.unrealengine.com/t/it-is-possible-to-draw-2d-line-in-edit-mode/468649>\
**Category:** Asset Creation\
**Tags:** debug, draw, line, unreal-engine, question\
**Created:** [July 25, 2020, 8:33am UTC](https://forums.unrealengine.com/t/it-is-possible-to-draw-2d-line-in-edit-mode/468649 "2020-07-25T08:33:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpotuznik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dpotuznik](https://forums.unrealengine.com/u/dpotuznik)\
**Post date:** [July 25, 2020, 8:33am UTC](https://forums.unrealengine.com/t/it-is-possible-to-draw-2d-line-in-edit-mode/468649/1 "2020-07-25T08:33:28Z")

</div>

Hi,  
for my tool i want to draw rectangle on the viewport on the edit mode  
i look for hours and nothing

it is simply possible ?  
if yes … how 🙂 ?

Thank you for your help.

Best Regards  
Daniel

---

<div class="post-metadata">

**Author:** ![knapeczadam](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@knapeczadam](https://forums.unrealengine.com/u/knapeczadam)\
**Post date:** [July 25, 2020, 9:09pm UTC](https://forums.unrealengine.com/t/it-is-possible-to-draw-2d-line-in-edit-mode/468649/2 "2020-07-25T21:09:20Z")

</div>

`DrawDebugHelpers.h` what you are looking for. It has a few useful global functions.

```
// FlushPersistentDebugLines(GetWorld());
const FVector A = FVector(0.0f, 0.0f, 0.0f);
const FVector B = FVector(100.0f, 0.0f, 0.0f);
const FVector C = FVector(100.0f, 50.0f, 0.0f);
const FVector D = FVector(0.0f, 50.0f, 0.0f);
DrawDebugLine(GetWorld(), A, B, FColor::Purple, true, -1, 0, 5);
DrawDebugLine(GetWorld(), B, C, FColor::Purple, true, -1, 0, 5);
DrawDebugLine(GetWorld(), C, D, FColor::Purple, true, -1, 0, 5);
DrawDebugLine(GetWorld(), D, A, FColor::Purple, true, -1, 0, 5);
```
