Constructor
new TextBox(x, y, txt, coloropt, sizeopt, fontopt)
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
x |
number | Centre x (px) | ||
y |
number | Centre y (px) | ||
txt |
string | Initial text | ||
color |
string | p5.Color |
<optional> |
'#fff' | Fill colour |
size |
number |
<optional> |
24 | Font size (px) |
font |
string |
<optional> |
'sans-serif' | Font family |
- Source:
Methods
moveTo(x, y)
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number | |
y |
number |
- Source:
setText(t)
Parameters:
| Name | Type | Description |
|---|---|---|
t |
string | New text |
- Source: