BackgroundSettings
ClassSettings for rendering the background on a Text component.
- Available on all platforms
Settings for rendering the background on a Text component.
Accessible through the Text component's backgroundSettings property.
Index
Properties
Methods
Example
//@input Component.Text textComponent
// Access the background object for a Text component
var bg = script.textComponent.backgroundSettings;
// Enable the background
bg.enabled = true;
// Set the background color
bg.fill.color = new vec4(1, 0, .5, 1);
// Extend the background left and right by 1 unit
bg.margins.left = 1.0;
bg.margins.right = 1.0;
Extends
Properties
cornerRadius
cornerRadius:
number
Controls how rounded the corner of the background should be.
Since
Lens Scripting Version 176
Default Value
0
enabled
enabled:
boolean
If enabled, the background will be rendered.
Default Value
false
fill
fill:
TextFill
Settings for how the inside of the background is drawn.
margins
margins:
Rect
Controls how far in each direction the background should extend away from the text.
Methods
getTypeName()
staticgetTypeName():TypeName<BackgroundSettings>
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<BackgroundSettings>
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean