The unique identifier for this control.
This is true if the control background is opaque else false.
Use opaque() and transparent() display / hide the background.
This is true if the control is visible else false.
Use hide() and show() to set visibility.
The type name for this control.
(type name = class name without the Cvs prefix)
Add a child to this control using its relative position [rx, ry]. If rx and ry are not provided then it uses the values set in the child.
is the actual control or its id
Optionalrx: numberOptionalry: numberthis control
Execute one or more configuration methods on this control.
The parameter is a user defined object where each field is the name of a configuration method and its value is the method's parameter(s). Multiple parameters should be in an array and use 'undefined' if the method expects no parameters.
This object will change the color scheme, text size and alignment, it will also make sure it is visible.
{ scheme : 'red', textSize : 12, textAlign: ['left', 'top'], show : undefined }
If the field name does not exist or not a valid function of this
control it will be silently ignored.
There is no error checking on the parameters, it is up to the user to ensure they are valid for the control method.
the configuration object
this control
Get or set the corner radii used for this control.
To set the radii the parameters must be one of the following
If no parameter is passed or does not match one of the above then an array of the currently used radii values.
valid radii combination
an array of the currently used radii values
Make this control invisible.
Optionalcascade: booleanif true hide any children
this control
Sets the icon and its alignment relative to any text in the control.
Processing constants can also be used to define the icon alignment.
the icon to show
OptionalalignH: string'left', 'right' or 'center'
OptionalalignV: string'top', 'bottom' or 'center'
this control or the current icon
Sets the horizontal and vertical icon aligment.
The following strings are recognised as valid alignments :-
Horz: 'left', 'right' or 'center' Vert: 'top', 'bottom' or 'center'
It will also accept the equivalent p5js constants :-
LEFT RIGHT CENTER TOP BOTTOM CENTER
Center icon alignment is only possible if there is no text. If there is some text it will use the default 'left'.
Unrecognized values are ignored and the icon allignment is unchanged.
Optionalhorz: string'left', 'right' or 'center'
Optionalvert: string'top', 'bottom' or 'center'
this control
Move this control relative to current position.
horizontal distance
vertical distance
this control
Move this control to an absolute position.
horizontal position
vertical position
this control
Makes the controls background opaque. The actual color depends on the controls color scheme.
The second parameter, alpha, is optional and controls the level of opaqueness from 0 - transparent to 255 - fully opaque (default value).
alpha value for controls background color.
this control
Sets this controls display orientation to one of the four cardinal compass points. An invalid parameter will set the orientation to 'east' which is the default value.
'north', 'south', 'east' or 'west'
this control
Adds this control to another control which becomes its parent.
is the parental control or its id
Optionalrx: numberx position relative to parent
Optionalry: numbery position relative to parent
this control
Remove a child control from this one so that it stays in same screen position.
the control to remove or its id
this control
If the name of a valid color scheme is provided then it will use it to display the control, non-existant scheme names will be ignored. In both cases this control is returned.
If there is no parameter it returns the name of the current color scheme used by this control.
Optionalname: stringthe color scheme name e.g. 'blue'
Optionalcascade: booleanif true propogate scheme to all child controls.
this control or the control's color scheme
An alternative to the enable / disable methods.
true / false
Optionalcascade: booleantrue apply to all children
this control
An alternative to the show / hide methods.
true / false
Optionalcascade: booleanif true hide children
this control
Make this control visible.
Optionalcascade: booleanif true then show any children
this control
Resize the control to fit the face content (text and/or icon).
The parameter values control which dimension(s), width and/or height, are changed and their minimum.
if ≤0 then leave the width unchanged otherwise it is the minimum width allowed after resizing.
if ≤0 then leave the height unchanged otherwise it is the minimum height allowed after resizing.
this control
Gets or sets the current text.
Processing constants are used to define the alignment.
Optionaltext: string | string[]the text to display
OptionalalignH: string'left', 'right' or 'center'
OptionalalignV: string'top', 'bottom' or 'center'
this control or the existing text
Sets the horizontal and vertical text aligment.
The following strings are recognised as valid styles :-
Horz: 'left', 'right' or 'center' Vert: 'top', 'bottom' or 'center'
It will also accept the equivalent p5js constants :-
LEFT RIGHT CENTER TOP BOTTOM CENTER
Unrecognized values are ignored and the text allignment is unchanged.
Optionalhorz: string'left', 'right' or 'center'
Optionalvert: string'top', 'bottom' or 'center'
this control
If no parameter is passed then the current font family name will be returned.
If a parameter is provided it will be accepted if it is one of the following :-
loadFont()
function.Any other parameter value will display a warning and be ignored leaving the font unchanged.
Optionalfont: string | objectsystem or logical font, a FontFace object or a p5js font object.
this control
Sets or gets the local text size.
Optionaltsize: numberthe text size to use
this control or the current text size
Sets or gets the local text style.
The following strings are recognised as valid styles :-
'normal' 'bold' 'thin' 'italic' 'bold italic' 'thin italic' 'oblique'
It will also accept the 4 p5js constants :-
NORMAL BOLD ITALIC BOLDITALIC
If the 'oblique' style is specified then the parameter 'slant' is the angle (degress) that the font is tilted from the vertical. An angle of +14° is the equivalent to 'italic' and 'normal' is 0°.
Unrecognized styles are ignored and the local style is left unchanged.
If no parameter is passed then the current style is returned.
Optionalstyle: stringthe font style to use.
the oblique slant angle (degrees)
this control
A label defines a rectangular control with text and/or icon
The label can be displayed with either text or icon or both on it's face. The text and icon alignment is configurable.