new TextBox(options)
Parameters:
Name |
Type |
Description |
options |
Object
|
Properties
Name |
Type |
Attributes |
Default |
Description |
name |
String
|
|
|
the name used when logging messages from this stimulus |
win |
module:core.Window
|
|
|
the associated Window |
text |
string
|
<optional>
|
""
|
the text to be rendered |
font |
string
|
<optional>
|
"Arial"
|
the font family |
pos |
Array.<number>
|
<optional>
|
[0, 0]
|
the position of the center of the text |
color |
Color
|
<optional>
|
Color('white')
|
the background color |
opacity |
number
|
<optional>
|
1.0
|
the opacity |
depth |
number
|
<optional>
|
0
|
the depth (i.e. the z order) |
contrast |
number
|
<optional>
|
1.0
|
the contrast |
units |
string
|
<optional>
|
"norm"
|
the units of the text size and position |
ori |
number
|
<optional>
|
0.0
|
the orientation (in degrees) |
height |
number
|
<optional>
|
0.1
|
the height of the text |
bold |
boolean
|
<optional>
|
false
|
whether or not the text is bold |
italic |
boolean
|
<optional>
|
false
|
whether or not the text is italic |
anchor |
string
|
<optional>
|
'left'
|
horizontal alignment |
multiline |
boolean
|
<optional>
|
false
|
whether or not a textarea is used |
autofocus |
boolean
|
<optional>
|
true
|
whether or not the first input should receive focus by default |
flipHoriz |
boolean
|
<optional>
|
false
|
whether or not to flip the text horizontally |
flipVert |
boolean
|
<optional>
|
false
|
whether or not to flip the text vertically |
clipMask |
PIXI.Graphics
|
<optional>
|
null
|
the clip mask |
autoDraw |
boolean
|
<optional>
|
false
|
whether or not the stimulus should be automatically drawn on every frame flip |
autoLog |
boolean
|
<optional>
|
false
|
whether or not to log |
|
- Mixes In:
- Source:
Extends
Members
(protected) _getDefaultLetterHeight
Get the default letter height given the stimulus' units.
- Source:
clear
Clears the current text value.
- Source:
getText
For accessing the underlying input value.
- Source:
reset
Clears the current text value or sets it back to match the placeholder.
- Source:
setSize
Setter for the size attribute.
- Source:
setText
For tweaking the underlying input value.
- Source:
Methods
(protected) _estimateBoundingBox()
Estimate the bounding box.
- Source:
(protected) _getAnchor() → {Array.<number>}
Convert the anchor attribute into numerical values.
- Source:
Returns:
- the anchor, as an array of numbers in [0,1]
-
Type
-
Array.<number>