VectorComposite.RenderRequest
ClassPer-draw options for VectorRenderer#render: where to draw (viewport), which part of the source to draw (region), and whether to clear first (clear).
- 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 v368
Per-draw options for VectorRenderer#render: where to draw (viewport),
which part of the source to draw (region), and whether to clear first
(clear). Leave viewport or region null — their default — to use the
whole target or full source; set either to a Rect to override it.
Index
Example
var req = new VectorComposite.RenderRequest();
req.region = Rect.create(0, 0.5, 0, 0.5); // a sub-region of the source
renderer.render(target, script.mySvg, req);
Extends
Constructors
Constructor
new RenderRequest():
RenderRequest
Returns
RenderRequest
Overrides
ScriptObject.constructor
Properties
clear
clear:
boolean
SPECS
Clear the entire target to transparent before drawing. Default true; pass
false to composite onto the existing target contents. Note: when a viewport
sub-region is set, clear still clears the whole target attachment, not just
the viewport.
Since
Lens Scripting Version 368
Default Value
true
@snapOS
region
region:
Rect
SPECS
Normalized [0, 1] sub-region of the source to draw. null (the default)
draws the full source.
Since
Lens Scripting Version 368
Default Value
null
@snapOS
viewport
viewport:
Rect
SPECS
Destination rect within the target, in normalized device coordinates
([-1, 1], origin at centre). null (the default) fills the whole target
((-1, -1) bottom-left to (1, 1) top-right).
Since
Lens Scripting Version 368
Default Value
null
@snapOS
Methods
getTypeName()
staticgetTypeName():TypeName<RenderRequest>
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<RenderRequest>
Since
Lens Scripting Version 368
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