Your browser does not support HTML5 Canvas

Notes:

Join the club, TNTClub that is! We wanted to be able to create graphics to support card games, so naturally, we needed this shape, composed of a TNTClover and a TNTSpire.

TNTClub Features and Usage:
Primary Attributes:

5 Parameters:

  • center: TNTPoint; located at the center of the body of the club
  • radius: decimals (known as a 'double' in code); the distance from the center of the clover to a petal; the base is scaled to that value
  • fillColor: TNTColor (can be null for a framework image)
  • borderColor: a TNTStroke: to set the border color as well as the thickness of the sides
  • rotationDeg: a 'double' that rotates the square about its center. rotn > 0 ==> counter clockwise; rotn < 0 ==> clockwise
To Create:

The example above was created by:

var center = new TNTPoint(3,1);

var myStroke = whiteStroke;
var aClub = new TNTClub(center, 3, black, myStroke, 10);
aClub.drawTNTClub(context);
                                    
To Draw: aClub.drawTNTClub(context);
Comments: This is the second shape in the JSGS to utilize the class keyword in JavaScript. Check it out in the source code.