Two.SVGRenderer

Extends: Two.Events

This class is used by Two when constructing with type of Two.Types.svg (the default type). It takes Two.js' scenegraph and renders it to a <svg />.

Constructor

ArgumentDescription
parametersThis object is inherited when constructing a new instance of Two.
parameters.domElementThe <svg /> to draw to. If none given a new one will be constructed.

Utils

A massive object filled with utility functions and properties to render Two.js objects to a <svg />.

domElement

The <svg /> associated with the Two.js scene.

scene

The root group of the scenegraph.

defs

The <defs /> to apply gradients, patterns, and bitmap imagery.

setSize

ArgumentDescription
widthThe new width of the renderer.
heightThe new height of the renderer.

Change the size of the renderer.

nota-bene

Triggers a Two.Events.resize.

render

Render the current scene to the <svg />.