Skip to main content

Class: Highlighter

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:39

An object that adds highlights to a block based on the given rendering information.

Highlighting is interesting because the highlights do not fully enclose the block. Instead, they are positioned based on a light source in the top left. This means that rendering highlights requires exact information about the position of each part of the block. The resulting paths are not continuous or closed paths. The highlights for tabs and notches are loosely based on tab and notch shapes, but are not exactly the same.

Properties index​

PropertyDescription
info_-
steps_-
inlineSteps_-
RTL_-
constants_-
highlightConstants_-
outsideCornerPaths_-
insideCornerPaths_-
puzzleTabPaths_-
notchPaths_-
startPaths_-
jaggedTeethPaths_-

Methods index​

MethodDescription
getPathGet the steps for the highlight path.
drawTopCornerAdd a highlight to the top corner of a block.
drawJaggedEdge_Add a highlight on a jagged edge for a collapsed block.
drawValueInputAdd a highlight on a value input.
drawStatementInputAdd a highlight on a statement input.
drawRightSideRowAdd a highlight on the right side of a row.
drawBottomRowAdd a highlight to the bottom row.
drawLeftDraw the highlight on the left side of the block.
drawInlineInputAdd a highlight to an inline input.

Constructors​

Constructor​

new Highlighter(info): Highlighter;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:58

Parameters​

ParameterTypeDescription
infoRenderInfoAn object containing all information needed to render this block.

Returns​

Highlighter

Properties​

info_​

info_: RenderInfo;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:40


steps_​

steps_: string = '';

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:41


inlineSteps_​

inlineSteps_: string = '';

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:42


RTL_​

RTL_: boolean;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:43


constants_​

constants_: ConstantProvider;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:44


highlightConstants_​

highlightConstants_: HighlightConstantProvider;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:45


outsideCornerPaths_​

outsideCornerPaths_: OutsideCorner;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:47


insideCornerPaths_​

insideCornerPaths_: InsideCorner;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:48


puzzleTabPaths_​

puzzleTabPaths_: PuzzleTab;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:49


notchPaths_​

notchPaths_: Notch;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:50


startPaths_​

startPaths_: StartHat;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:51


jaggedTeethPaths_​

jaggedTeethPaths_: JaggedTeeth;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:52

Methods​

getPath()​

getPath(): string;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:85

Get the steps for the highlight path.

Returns​

string

The steps for the highlight path.


drawTopCorner()​

drawTopCorner(row): void;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:94

Add a highlight to the top corner of a block.

Parameters​

ParameterTypeDescription
rowTopRowThe top row of the block.

Returns​

void


drawJaggedEdge_()​

drawJaggedEdge_(row): void;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:126

Add a highlight on a jagged edge for a collapsed block.

Parameters​

ParameterTypeDescription
rowRowThe row to highlight.

Returns​

void


drawValueInput()​

drawValueInput(row): void;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:140

Add a highlight on a value input.

Parameters​

ParameterTypeDescription
rowRowThe row the input belongs to.

Returns​

void


drawStatementInput()​

drawStatementInput(row): void;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:164

Add a highlight on a statement input.

Parameters​

ParameterTypeDescription
rowRowThe row to highlight.

Returns​

void


drawRightSideRow()​

drawRightSideRow(row): void;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:194

Add a highlight on the right side of a row.

Parameters​

ParameterTypeDescription
rowRowThe row to highlight.

Returns​

void


drawBottomRow()​

drawBottomRow(row): void;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:215

Add a highlight to the bottom row.

Parameters​

ParameterTypeDescription
rowBottomRowThe row to highlight.

Returns​

void


drawLeft()​

drawLeft(): void;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:240

Draw the highlight on the left side of the block.

Returns​

void


drawInlineInput()​

drawInlineInput(input): void;

Defined in: packages/blockly/core/renderers/geras/highlighter.ts:278

Add a highlight to an inline input.

Parameters​

ParameterTypeDescription
inputInlineInputThe input to highlight.

Returns​

void