Creates an instance of a Message.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object |
optional
An options object to specify to style and behaviour of the message.
|
- 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
Members
-
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.