BackgroundSettings
Lens Studio v2.1+
Inherits from ScriptObject
Description
Settings for rendering the background on a Text component. Accessible through the Text component’s backgroundSettings
property.
Properties
enabled
: Boolean
If enabled, the background will be rendered.
fill
: TextFill
Settings for how the inside of the background is drawn.
margins
: Rect
Controls how far in each direction the background should extend away from the text.
Inherited Methods
getTypeName()
: String
Returns the name of this object’s type.
isOfType(String type)
: Boolean
Returns true if the object matches or derives from the passed in type.
Examples
//@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;
Still Looking for help?
Visit Support