Notes:
Let's call a spade a TNTSpade. To support card games, we needed this shape, composed of a TNTHeart and a TNTSpire.
As with TNTClub, the 'stem' of the spade received its parameters based on the overall parameters of the spade. This way, everything scales appropriately, as shown in the figure above.
TNTSpade Features and Usage:
| Primary Attributes: |
5 Parameters:
|
|---|---|
| To Create: |
The example above was created by:
var center = new TNTPoint(3,3);
var myStroke = null;
var aSpade = new TNTSpade(center, 6, black, myStroke, 0);
aSpade.drawTNTSpade(context);
var anotherSpade = new TNTSpade(center.translate(-9, -8), 2, red, null, 0);
anotherSpade.drawTNTSpade(context);
|
| To Draw: | aSpade.drawTNTSpade(context); |
| Comments: | This is the third shape in the JSGS to utilize the TNTHeart is a complicated figure and to maintain its heart shape, the basic parameters that create it must be scaled by a scaling factor. Look at its source code: we added a method, calcFactor, that used linear regression to compute the correct factor for a given radius. We ♥ math! |
