Constructor
new LettersInterface(pos, width, height, strokeWeightopt, strokeColopt)
Constructs a new instance of LettersIngterface
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pos |
p5.Vector | The top left position in pixels | ||
width |
number | The width in pixels | ||
height |
number | The height in pixels | ||
strokeWeight |
number |
<optional> |
1 | The stroke weight |
strokeCol |
number |
<optional> |
255 | The stroke col |
- Source:
Members
alphabet :Object
Type:
- Object
- Source:
Methods
calculateLocations()
Calculates the locations of the parts of the letters drawing. Is called
on instantiation of the class as well as during resizing events.
- Source:
draw()
Draw the letters interface on the canvas.
- Source:
pickLetter(letter) → {boolean}
Picks a letter from the alphabet and sets the flag in the alphabet object
for that letter to true. This causes the letter to be drawn with a
different background.
Parameters:
Name | Type | Description |
---|---|---|
letter |
string | The letter |
- Source:
Returns:
If the letter was in the alphabet return true
- Type
- boolean
resize(pos, width, height)
Resizes the letters interface
Parameters:
Name | Type | Description |
---|---|---|
pos |
p5.Vector | The position of the top left in pixels |
width |
number | The width in pixels |
height |
number | The height in pixels |
- Source: