Your browser does not support HTML5 Canvas

Notes:

A self-evident shape!

TNTPacMan Features and Usage:
Primary Attributes:

8 Parameters:

  • center: TNTPoint
  • radius: a decimal (known as a 'double' in code)
  • mouthAngleDeg: a decimal ('double'). Positive angles are counter-clockwise; negative angles are clockwise.
  • fillColor1: TNTColor (can be null for a framework image)
  • fillColor2: TNTColor (can be null for a framework image)
  • stroke1: a TNTStroke: to set the border color as well as the thickness of the sides
  • stroke2: 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(0, 0);
var radius = 10;
var mouthAngleDeg = 40;

var fcolr1 = yellow;
var stroke1 = blueStroke;

var fcolr2 = offWhite;
var stroke2 = redStroke;

var rotn = 30;
var myMan = new TNTPacMan(center, 
    radius, mouthAngleDeg, fcolr1, 
    fcolr2, stroke1, stroke2, rotn);
myMan.drawTNTPacMan(context);
                                    
To Draw: myMan.drawTNTPacMan(context);
Comments:

There may have been easier 'engines' we could have used to make this shape, but it does work!