Constructor

Renderer

new Renderer()

The base class for a block renderer.

Property

constants_

non-null Blockly.blockRendering.ConstantProvider

Methods

getConstants

package

getConstants() returns Blockly.blockRendering.ConstantProvider

Get the current renderer's constant provider. We assume that when this is called, the renderer has already been initialized.

Returns

non-null Blockly.blockRendering.ConstantProvider The constant provider.

init

package

init()

Initialize the renderer.

makeConstants_

protected

makeConstants_() returns Blockly.blockRendering.ConstantProvider

Create a new instance of the renderer's constant provider.

Returns

non-null Blockly.blockRendering.ConstantProvider The constant provider.

makeCursorDrawer

package

makeCursorDrawer(workspace, opt_marker) returns Blockly.CursorSvg

Create a new instance of the renderer's cursor drawer.

Parameter

workspace

Blockly.WorkspaceSvg

The workspace the cursor belongs to.

Value must not be null.

opt_marker

Optional

boolean

True if the cursor is a marker. A marker is used to save a location and is an immovable cursor. False or undefined if the cursor is not a marker.

Returns

non-null Blockly.CursorSvg The cursor drawer.

makeDebugger_

protected

makeDebugger_() returns Blockly.blockRendering.Debug

Create a new instance of the renderer's debugger.

Returns

non-null Blockly.blockRendering.Debug The renderer debugger.

makeDrawer_

protected

makeDrawer_(block, info) returns Blockly.blockRendering.Drawer

Create a new instance of the renderer's drawer.

Parameter

block

Blockly.BlockSvg

The block to render.

Value must not be null.

info

Blockly.blockRendering.RenderInfo

An object containing all information needed to render this block.

Value must not be null.

Returns

non-null Blockly.blockRendering.Drawer The drawer.

makeHighlightConstants_

protected

makeHighlightConstants_() returns Blockly.geras.HighlightConstantProvider

Create a new instance of the renderer's highlight constant provider.

Returns

non-null Blockly.geras.HighlightConstantProvider The highlight constant provider.

makePathObject

package

makePathObject(root) returns Blockly.blockRendering.IPathObject

Create a new instance of a renderer path object.

Parameter

root

SVGElement

The root SVG element.

Value must not be null.

Returns

non-null Blockly.blockRendering.IPathObject The renderer path object.

makeRenderInfo_

protected

makeRenderInfo_(block) returns Blockly.blockRendering.RenderInfo

Create a new instance of the renderer's render info object.

Parameter

block

Blockly.BlockSvg

The block to measure.

Value must not be null.

Returns

non-null Blockly.blockRendering.RenderInfo The render info object.

render

package

render(block)

Render the block.

Parameter

block

Blockly.BlockSvg

The block to render.

Value must not be null.