Class: Tooltip

Tooltip

Class that represents a PixiJS Tooltip.

new Tooltip (opts)

Creates an instance of a Tooltip.

Name Type Description
opts object optional

An options object to specify to style and behaviour of the tooltip.

Name Type Default Description
minWidth number 0 optional

The minimum width of the tooltip.

minHeight number 0 optional

The minimum height of the tooltip.

padding number Theme.padding / 2 optional

The inner spacing of the tooltip.

object PIXI.DisplayObject

The object, where the tooltip should be displayed.

container PIXI.DisplayObject object optional

The container where the tooltip should be attached to.

offsetLeft number 8 optional

The horizontal shift of the tooltip.

offsetTop number -8 optional

The vertical shift of the tooltip.

delay number 0 optional

A delay, after which the tooltip should be opened.

See:
Example
// Create the app
const app = new PIXIApp({
    view: canvas,
    width: 900,
    height: 250
}).setup().run()

// Add an DisplayObject to the app
const circle = new PIXI.Graphics()
circle.beginFill(0x5251a3)
circle.drawCircle(50, 50, 40)
app.scene.addChild(circle)

const tooltip = new Tooltip({
    object: circle,
    container: app.scene,
    content: 'Das Gesetz ist der Freund des Schwachen.'
})

Extends

Members

content string | number | PIXI.DisplayObject inherited overrides

Sets or gets the content. The getter always returns an PIXI.DisplayObject. The setter can receive a string, a number or a PIXI.DisplayObject.

Sets or gets the header. The getter always returns a PIXI.Text object. The setter can receive a string, a number or a PIXI.Text object.

Methods

Hides the popup (sets his alpha values to 0).

Name Type Description
cb callback optional

Executed when hide animation was completed.

Returns:
Type Description
AbstractPopup A reference to the popup for chaining.

Should be called to refresh the layout of the popup. Can be used after resizing.

Returns:
Type Description
AbstractPopup A reference to the popup for chaining.

Shows the popup (sets his alpha values to 1).

Name Type Description
cb callback optional

Executed when show animation was completed.

Returns:
Type Description
AbstractPopup A reference to the popup for chaining.