Stay organized with collections Save and categorize content based on your preferences.

blockly > Bubble

Bubble class

Class for UI bubble.

Signature:

export declare class Bubble implements IBubble 

Implements: IBubble

Constructors

Constructor Modifiers Description
(constructor)(workspace, content, shape, anchorXY, bubbleWidth, bubbleHeight) Constructs a new instance of the Bubble class

Properties

Property Modifiers Type Description
ANCHOR_RADIUS static number Distance between arrow point and anchor point.
ARROW_ANGLE static number The number of degrees that the arrow bends counter-clockwise.
ARROW_BEND static number The sharpness of the arrow's bend. Higher numbers result in smoother arrows.
ARROW_THICKNESS static number Determines the thickness of the base of the arrow in relation to the size of the bubble. Higher numbers result in thinner arrows.
BORDER_WIDTH static number Width of the border around the bubble.
content_ SVGElement
shape_ SVGElement
workspace_ WorkspaceSvg

Methods

Method Modifiers Description
dispose() Dispose of this bubble.
getBubbleSize() Get the dimensions of this bubble.
getRelativeToSurfaceXY() Return the coordinates of the top-left corner of this bubble's body relative to the drawing surface's origin (0,0), in workspace units.
getSvgRoot() Return the root node of the bubble's SVG group.
registerMoveEvent(callback) Register a function as a callback event for when the bubble is moved.
registerResizeEvent(callback) Register a function as a callback event for when the bubble is resized.
setAnchorLocation(xy) Notification that the anchor has moved. Update the arrow and bubble accordingly.
setBubbleSize(width, height) Size this bubble.
setColour(hexColour) Change the colour of a bubble.
setDeleteStyle(_enable) Update the style of this bubble when it is dragged over a delete area.
setSvgId(id) Expose the block's ID on the bubble's top-level SVG group.