VectorStroke
ClassAn immutable stroke style — width, line cap, line join, miter limit, and an optional dash pattern.
- Snapchat: not supported
- SPECS: fully supported
- Camera Kit Web: not supported
- Camera Kit Mobile: not supported
- SnapchatNot supported — Available on SPECS only
- SPECSFully supported
- Camera Kit WebNot supported — Available on SPECS only
- Camera Kit MobileNot supported — Available on SPECS only
Since Lens Scripting v370
An immutable stroke style — width, line cap,
line join, miter limit, and an optional dash
pattern. Produced by VectorStrokeBuilder#build and never mutated after.
A stroke carries only style (no path geometry), so it is freely shareable: pass
the same VectorStroke to multiple VectorCompositeBuilder#addStroke calls
to stroke several paths with one style. Exposes read-only metadata —
VectorStroke#width, VectorStroke#cap, VectorStroke#join,
VectorStroke#miterLimit, and VectorStroke#dashed.
Index
Properties
Methods
Example
var sb = VectorStrokeBuilder.create(6);
sb.setCap(VectorComposite.LineCap.Round);
sb.setJoin(VectorComposite.LineJoin.Round);
sb.setDash([24, 12], 0);
var stroke = sb.build();
print(stroke.width); // 6
print(stroke.dashed); // true
Extends
Properties
cap
readonlycap:LineCap
SPECS
The VectorComposite.LineCap — how the ends of open sub-paths and dash segments are rendered.
Since
Lens Scripting Version 370
dashed
readonlydashed:boolean
SPECS
Whether this stroke is dashed — true when an explicit dash pattern is set,
false for a continuous line (the default).
Since
Lens Scripting Version 370
join
readonlyjoin:LineJoin
SPECS
The VectorComposite.LineJoin — how corners between connected path segments are rendered.
Since
Lens Scripting Version 370
miterLimit
readonlymiterLimit:number
SPECS
The miter limit — controls when a Miter join falls back to a bevel. Always greater than or equal to 1.
Since
Lens Scripting Version 370
width
readonlywidth:number
SPECS
The stroke width in the composite's coordinate space. Always greater than 0.
Since
Lens Scripting Version 370
Methods
getTypeName()
staticgetTypeName():TypeName<VectorStroke>
SPECS
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<VectorStroke>
Since
Lens Scripting Version 370
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