Notes:
Two (TNT)Points make a line, right? Good ole Geometry! Two examples of a TNTLine are shown above. A quick peek at the source code (tntLine.js) reveals we first created a custom TNTColor (tangerine), followed by a custom TNTStroke (tangerineStroke). Then, we had all the ingredients we needed to make a TNTLine: a couple of TNTPoints and a TNTStroke.
TNTLine Features and Usage:
| Primary Attributes: | 2 TNTPoints and a TNTStroke |
|---|---|
| To Create: | var lineAB = new TNTLine(ptA, ptB, tangerineStroke); |
| To Draw: | lineAB.drawTNTLine(context); |
| Comments: | The TNTStroke attribute of a TNTLine is an object that contains both the thickness and the color of the line. A common mistake when creating a TNTLine is to provide merely a TNTColor rather than a TNTStroke. |
| Even More: | When drawing a TNTLine as well as most other library shapes with the exception of TNTPoint, you just have to provide 'context' as a parameter for the drawing function. That 'context' is like providing the proper, scaled graph paper for the graphical object. The TNTPoints used to make the TNTLine may be shown or hidden by using the 'showPoints' attribute (set to either true or false). Accent colors are those used for showing the points when you wish them shown. |
