Class: Message

Message

Class that represents a Message. A message pops up and disappears after a specific amount of time.

new Message (opts)

Creates an instance of a Message.

Name Type Description
opts object optional

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

Name Type Default Description
app PIXIApp window.app optional

The PIXIApp where this message belongs to.

closeButton boolean false optional

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

minWidth number 280 optional

The minimum width of the message box. Automatically expands with the content.

minHeight number 100 optional

The minimum height of the message box. Automatically expands with the content.

margin number Theme.margin optional

The outer spacing of the message box.

align string right optional

The horizontal position of the message box relative to the app. Possible values are left, center, right.

verticalAlign string top optional

The vertical position of the message box relative to the app. Possible values are top, middle, bottom.

duration number 5 optional

The duration in seconds when the message box should disappear.

autoClose boolean true optional

Should the message box be closed automatically?

closeDuration number Theme.fast optional

The duration in seconds of the closing of the message box.

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

// Create a button
let button = new Button({
    label: 'Click me',
    action: e => {
        const message = new Message({
            app: app,
            header: 'Header',
            content: 'Text.'
        })
        app.scene.addChild(message)
    }
})

// Add the button to the scene
app.scene.addChild(button)

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.

Relayouts the position of the message box.

Returns:
Type Description
Message Returns the message box for chaining.