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
| Property | Description |
|---|---|
| info_ | - |
| steps_ | - |
| inlineSteps_ | - |
| RTL_ | - |
| constants_ | - |
| highlightConstants_ | - |
| outsideCornerPaths_ | - |
| insideCornerPaths_ | - |
| puzzleTabPaths_ | - |
| notchPaths_ | - |
| startPaths_ | - |
| jaggedTeethPaths_ | - |
Methods index
| Method | Description |
|---|---|
| getPath | Get the steps for the highlight path. |
| drawTopCorner | Add a highlight to the top corner of a block. |
| drawJaggedEdge_ | Add a highlight on a jagged edge for a collapsed block. |
| drawValueInput | Add a highlight on a value input. |
| drawStatementInput | Add a highlight on a statement input. |
| drawRightSideRow | Add a highlight on the right side of a row. |
| drawBottomRow | Add a highlight to the bottom row. |
| drawLeft | Draw the highlight on the left side of the block. |
| drawInlineInput | Add a highlight to an inline input. |
Constructors
Constructor
new Highlighter(info): Highlighter;
Defined in: packages/blockly/core/renderers/geras/highlighter.ts:58
Parameters
| Parameter | Type | Description |
|---|---|---|
info | RenderInfo | An 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
| Parameter | Type | Description |
|---|---|---|
row | TopRow | The 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
| Parameter | Type | Description |
|---|---|---|
row | Row | The 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
| Parameter | Type | Description |
|---|---|---|
row | Row | The 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
| Parameter | Type | Description |
|---|---|---|
row | Row | The 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
| Parameter | Type | Description |
|---|---|---|
row | Row | The 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
| Parameter | Type | Description |
|---|---|---|
row | BottomRow | The 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
| Parameter | Type | Description |
|---|---|---|
input | InlineInput | The input to highlight. |
Returns
void