Class: InsertionMarkerPreviewer
Defined in: packages/blockly/core/insertion_marker_previewer.ts:21
Displays visual "previews" of where a block will be connected if it is dropped.
Implements
Properties index
| Property | Description |
|---|---|
| useFastInsertionMarkers | If set to true, uses a faster method for rendering insertion markers which will become the default in v14. This rendering method is enabled for the built-in Thrasos, Geras and Zelos renderers regardless of the state of this flag. Custom renderers will use the old rendering behavior unless this is set to true. This field will be removed in v14. |
Methods index
| Method | Description |
|---|---|
| previewReplacement | Display a connection preview where the draggedCon connects to the staticCon, replacing the replacedBlock (currently connected to the staticCon). |
| previewConnection | Display a connection preview where the draggedCon connects to the staticCon, and no block is being replaced. |
| serializeBlockToInsertionMarker | Transforms the given block into a JSON representation used to construct an insertion marker. |
| hidePreview | Hide any previews that are currently displayed. |
| dispose | Dispose of any references held by this connection previewer. |
Constructors
Constructor
new InsertionMarkerPreviewer(draggedBlock): InsertionMarkerPreviewer;
Defined in: packages/blockly/core/insertion_marker_previewer.ts:43
Parameters
| Parameter | Type |
|---|---|
draggedBlock | BlockSvg |
Returns
InsertionMarkerPreviewer
Properties
useFastInsertionMarkers
static useFastInsertionMarkers: boolean = false;
Defined in: packages/blockly/core/insertion_marker_previewer.ts:41
If set to true, uses a faster method for rendering insertion markers which will become the default in v14. This rendering method is enabled for the built-in Thrasos, Geras and Zelos renderers regardless of the state of this flag. Custom renderers will use the old rendering behavior unless this is set to true. This field will be removed in v14.
Methods
previewReplacement()
previewReplacement(
draggedConn,
staticConn,
replacedBlock
): void;
Defined in: packages/blockly/core/insertion_marker_previewer.ts:60
Display a connection preview where the draggedCon connects to the staticCon, replacing the replacedBlock (currently connected to the staticCon).
Parameters
| Parameter | Type | Description |
|---|---|---|
draggedConn | RenderedConnection | The connection on the block stack being dragged. |
staticConn | RenderedConnection | The connection not being dragged that we are connecting to. |
replacedBlock | BlockSvg | The block currently connected to the staticCon that is being replaced. |
Returns
void
Implementation of
IConnectionPreviewer.previewReplacement
previewConnection()
previewConnection(draggedConn, staticConn): void;
Defined in: packages/blockly/core/insertion_marker_previewer.ts:87
Display a connection preview where the draggedCon connects to the staticCon, and no block is being replaced.
Parameters
| Parameter | Type | Description |
|---|---|---|
draggedConn | RenderedConnection | The connection on the block stack being dragged. |
staticConn | RenderedConnection | The connection not being dragged that we are connecting to. |
Returns
void
Implementation of
IConnectionPreviewer.previewConnection
serializeBlockToInsertionMarker()
protected serializeBlockToInsertionMarker(block): State;
Defined in: packages/blockly/core/insertion_marker_previewer.ts:186
Transforms the given block into a JSON representation used to construct an insertion marker.
Parameters
| Parameter | Type | Description |
|---|---|---|
block | BlockSvg | The block to serialize and use as an insertion marker. |
Returns
A JSON-formatted string corresponding to a serialized representation of the given block suitable for use as an insertion marker.
hidePreview()
hidePreview(): void;
Defined in: packages/blockly/core/insertion_marker_previewer.ts:244
Hide any previews that are currently displayed.
Returns
void
Implementation of
IConnectionPreviewer.hidePreview
dispose()
dispose(): void;
Defined in: packages/blockly/core/insertion_marker_previewer.ts:291
Dispose of any references held by this connection previewer.
Returns
void