Game Development Community

2D Line Drawing

by Frank Korf · in Torque Game Engine · 03/26/2007 (9:01 am) · 3 replies

Hey-

I would like to draw a simple 2D line in-game. Ideally, I would like to define a starting point, and end point, a color, and a thickness. I need this for some effects I am doing in an over-head map.

Has anybody ever tried anything like this? If not, do you guys/ladies have any tips on how to start coding this?

#1
03/26/2007 (12:38 pm)
You can use simple OpenGL calls to draw lines. Have a look at how it's done in WorldEditor.cc. The draw lines for the XYZ gizmos, which is the code you need.
#2
03/26/2007 (3:01 pm)
Thanks!
#3
03/27/2007 (7:06 am)
Http://www.garagegames.com/docs/tge/engine/group__dgl__primitive.php

This was helpful. In case anybody was curious.