Class: Popup

Popup

Class that represents a PixiJS Popup.

Creates an instance of a Popup.

Name Type Description
opts object optional

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

Name Type Default Description
closeButton boolean false optional

Should a close button be displayed on the upper right corner?

minWidth number 0 optional

The minimum width of the popup.

minHeight number 0 optional

The minimum height of the popup.

See:
Example
// Create the popup
const popup = new Popup({
    header: 'Goethe',
    content: 'Man kann die Erfahrung nicht früh genug machen, wie entbehrlich man in der Welt ist.'
})

// Add the popup to a DisplayObject
app.scene.addChild(popup)

Extends

Classes

InteractivePopup
InteractivePopup

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.