Class: Volatile

Volatile

Class that represents a PixiJS Volatile.

new Volatile (opts)

Creates an instance of a Volatile.

Name Type Description
opts object optional

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

Name Type Default Description
id number auto generated optional

The id of the tooltip.

object PIXI.DisplayObject | Array.<PIXI.DisplayObject>

The object where the volatile should be applied to.

direction string top optional

The animation direction. Possible values: top, right, bottom, left.

onStart function optional

A function which is executed when the volatile animation starts.

onComplete function optional

A function which is executed when the volatile animation finishes.

distance number 160 optional

The animation distance.

duration number 1.5 optional

The duration of the animation in seconds.

ease object Quad.easeOut optional

The easing of the animation, see https://greensock.com/docs/Easing

destroyOnComplete boolean true optional

Should the object be destroyed after the volatile animation?

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

const button = new Button({
    label: 'Volatile!',
    action: () => {
        new Volatile({
            object: button,
            direction: 'right',
            destroyOnComplete: false
        })
    }
})

app.scene.addChild(button)

Methods

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

Returns:
Type Description
Volatile A reference to the volatile for chaining.