# formatStringForName(contents)
private method
Format string as name.
Parameters
Name | Types | Description |
---|---|---|
contents | String |
String to format. |
Returns
String
Formatted string.
# formatStringForParam(contents)
private method
Format string as param.
Parameters
Name | Types | Description |
---|---|---|
contents | String |
String to format. |
Returns
String
Formatted string.
# formatStringForUID(contents)
private method
Format string as UID.
Parameters
Name | Types | Description |
---|---|---|
contents | String |
String to format. |
Returns
String
Formatted string.
# parser(content, filename)
Dox parser for doxdox.
Parameters
Name | Types | Description |
---|---|---|
content | String |
Contents of file. |
filename | String |
Name of file. Used to generate UIDs. |
Returns
Promise
Promise with methods parsed from contents.
# exports.escape(html)
Escape the given html
.
Parameters
Name | Types | Description |
---|---|---|
html | String |
string to be escaped |
# Facade(canvas, width, height)
Creates a new Facade.js object with either a preexisting canvas tag or a unique name, width, and height.
Parameters
Name | Types | Description |
---|---|---|
canvas | Object |
String |
width | Integer |
Width of the canvas. |
height | Integer |
Height of the canvas. |
Returns
Object
New Facade.js object.
# Facade.addToStage(obj, options)
Draws a Facade.js entity (or multiple entities) to the stage.
Parameters
Name | Types | Description |
---|---|---|
obj | Object |
Array |
options | Object |
Temporary options for rendering a Facade.js entity (or multiple entities). |
Returns
Object
Facade.js object.
# Facade.Polygon(options, options.anchor, options.closePath, options.fillStyle, options.lineCap, options.lineJoin, options.lineWidth, options.opacity, options.points, options.rotate, options.scale, options.strokeStyle, options.x, options.y)
Create a polygon object. Inherits all methods from Facade.Entity. var polygon = new Facade.Polygon({ x: 0, y: 0, points: [ [100, 0], [200, 100], [100, 200], [0, 100] ], lineWidth: 10, strokeStyle: '#333E4B', fillStyle: '#1C73A8', anchor: 'top/left' });
Parameters
Name | Types | Description |
---|---|---|
options | Object |
Options to create the polygon with. |
options.anchor | String |
Position to anchor the polygon. Default: "top/left"
|
options.closePath | Boolean |
Boolean to determine if the polygon should be self closing or not. Default: true |
options.fillStyle | String |
Fill color for the polygon. Can be a text representation of a color, HEX, RGB(a), HSL(a). Default: "#000"
|
options.lineCap | String |
The style of line cap. Default: "butt"
|
options.lineJoin | String |
The style of line join. Default: "miter"
|
options.lineWidth | Integer |
Width of the stroke. Default: 0 |
options.opacity | Integer |
Opacity of the polygon. Integer between 0 and 100. Default: 100 |
options.points | Array |
Multi-dimensional array of points used to render a polygon. Point arrays with 2 values is rendered as a line, 5 values is rendered as an arc and 6 values is rendered as a bezier curve. |
options.rotate | Integer |
Degrees to rotate the polygon. Default: 0 |
options.scale | Integer |
A float representing the scale of a polygon. Default: 1 |
options.strokeStyle | String |
Color of a polygon's stroke. Can be a text representation of a color, HEX, RGB(a), HSL(a). Default: "#000"
|
options.x | Integer |
X coordinate to position the polygon. Default: 0 |
options.y | Integer |
Y coordinate to position the polygon. Default: 0 |
Returns
Object
New Facade.Polygon object.
# Facade.Polygon._defaultOptions(updated)
private method
Returns a default set of options common to all Facade.js polygon entities.
Parameters
Name | Types | Description |
---|---|---|
updated | Object |
Additional options as key-value pairs. |
Returns
Object
Default set of options.
# Facade.Polygon._draw(facade, options, metrics)
private method
Renders a polygon entity to a canvas.
Parameters
Name | Types | Description |
---|---|---|
facade | Object |
Facade.js object. |
options | Object |
Options used to render the polygon. |
metrics | Object |
Metrics used to render the polygon. |
Returns
Void