How to use the @pixi/ticker.Ticker.shared function in @pixi/ticker

To help you get started, we’ve selected a few @pixi/ticker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pixijs / pixi.js / packages / core / src / textures / resources / VideoResource.js View on Github external
_onPlayStart()
    {
        // Just in case the video has not received its can play even yet..
        if (!this.valid)
        {
            this._onCanPlay();
        }

        if (!this._isAutoUpdating && this.autoUpdate)
        {
            Ticker.shared.add(this.update, this);
            this._isAutoUpdating = true;
        }
    }
github pixijs / pixi.js / packages / core / src / textures / resources / VideoResource.js View on Github external
_onPlayStart()
    {
        // Just in case the video has not received its can play even yet..
        if (!this.valid)
        {
            this._onCanPlay();
        }

        if (!this._isAutoUpdating && this.autoUpdate)
        {
            Ticker.shared.add(this.update, this);
            this._isAutoUpdating = true;
        }
    }
github pixijs / pixi-sound / src / htmlaudio / HTMLAudioInstance.ts View on Github external
this._source.onloadedmetadata = () => {
            if (this._source)
            {
                this._source.currentTime = start;
                this._source.onloadedmetadata = null;
                this.emit("progress", start, this._duration);
                Ticker.shared.add(this._onUpdate, this);
            }
        };
        this._source.onended = this._onComplete.bind(this);
github pixijs / pixi-sound / src / webaudio / WebAudioInstance.ts View on Github external
private set _enabled(enabled: boolean)
    {
        Ticker.shared.remove(this._updateListener, this);
        if (enabled)
        {
            Ticker.shared.add(this._updateListener, this);
        }
    }
github pixijs / pixi-sound / src / webaudio / WebAudioInstance.ts View on Github external
private set _enabled(enabled: boolean)
    {
        Ticker.shared.remove(this._updateListener, this);
        if (enabled)
        {
            Ticker.shared.add(this._updateListener, this);
        }
    }
github pixijs / pixi.js / packages / interaction / src / InteractionManager.js View on Github external
removeEvents()
    {
        if (!this.interactionDOMElement)
        {
            return;
        }

        Ticker.shared.remove(this.update, this);

        if (window.navigator.msPointerEnabled)
        {
            this.interactionDOMElement.style['-ms-content-zooming'] = '';
            this.interactionDOMElement.style['-ms-touch-action'] = '';
        }
        else if (this.supportsPointerEvents)
        {
            this.interactionDOMElement.style['touch-action'] = '';
        }

        if (this.supportsPointerEvents)
        {
            window.document.removeEventListener('pointermove', this.onPointerMove, true);
            this.interactionDOMElement.removeEventListener('pointerdown', this.onPointerDown, true);
            this.interactionDOMElement.removeEventListener('pointerleave', this.onPointerOut, true);
github pixijs / pixi.js / packages / sprite-animated / src / AnimatedSprite.js View on Github external
stop()
    {
        if (!this.playing)
        {
            return;
        }

        this.playing = false;
        if (this._autoUpdate)
        {
            Ticker.shared.remove(this.update, this);
        }
    }

@pixi/ticker

Tickers are control the timings within PixiJS

MIT
Latest version published 8 months ago

Package Health Score

91 / 100
Full package analysis

Similar packages