Is there a way to create line on playcanvas's screen

With the image elements, you can get the canvas position of the corners to help work out where line start and end points are: https://developer.playcanvas.com/api/pc.ElementComponent.html#canvasCorners

Alternatively, you can try to use an image element for the line and position it via the global/world position using the information here: Dropdown For Different Aspect Ratios - #4 by yaustar

It’s going to be a little tricky no matter which method you use though