Home

constant: shared


  {
    "comment": "/**\n * The shared ticker instance used by {@link PIXI.extras.AnimatedSprite}.\n * and by {@link PIXI.interaction.InteractionManager}.\n * The property {@link PIXI.ticker.Ticker#autoStart} is set to `true`\n * for this instance. Please follow the examples for usage, including\n * how to opt-out of auto-starting the shared ticker.\n *\n * @example\n * let ticker = PIXI.ticker.shared;\n * // Set this to prevent starting this ticker when listeners are added.\n * // By default this is true only for the PIXI.ticker.shared instance.\n * ticker.autoStart = false;\n * // FYI, call this to ensure the ticker is stopped. It should be stopped\n * // if you have not attempted to render anything yet.\n * ticker.stop();\n * // Call this when you are ready for a running shared ticker.\n * ticker.start();\n *\n * @example\n * // You may use the shared ticker to render...\n * let renderer = PIXI.autoDetectRenderer(800, 600);\n * let stage = new PIXI.Container();\n * let interactionManager = PIXI.interaction.InteractionManager(renderer);\n * document.body.appendChild(renderer.view);\n * ticker.add(function (time) {\n *     renderer.render(stage);\n * });\n *\n * @example\n * // Or you can just update it manually.\n * ticker.autoStart = false;\n * ticker.stop();\n * function animate(time) {\n *     ticker.update(time);\n *     renderer.render(stage);\n *     requestAnimationFrame(animate);\n * }\n * animate(performance.now());\n *\n * @type {PIXI.ticker.Ticker}\n * @memberof PIXI.ticker\n */",
    "meta": {
        "range": [
            1494,
            1515
        ],
        "filename": "index.js",
        "lineno": 45,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core\\ticker",
        "code": {
            "id": "astnode100120718",
            "name": "shared",
            "type": "NewExpression",
            "value": ""
        }
    },
    "description": "

The shared ticker instance used by {@link PIXI.extras.AnimatedSprite}.
and by {@link PIXI.interaction.InteractionManager}.
The property {@link PIXI.ticker.Ticker#autoStart} is set to true
for this instance. Please follow the examples for usage, including
how to opt-out of auto-starting the shared ticker.

", "examples": [ "let ticker = PIXI.ticker.shared;\n// Set this to prevent starting this ticker when listeners are added.\n// By default this is true only for the PIXI.ticker.shared instance.\nticker.autoStart = false;\n// FYI, call this to ensure the ticker is stopped. It should be stopped\n// if you have not attempted to render anything yet.\nticker.stop();\n// Call this when you are ready for a running shared ticker.\nticker.start();", "// You may use the shared ticker to render...\nlet renderer = PIXI.autoDetectRenderer(800, 600);\nlet stage = new PIXI.Container();\nlet interactionManager = PIXI.interaction.InteractionManager(renderer);\ndocument.body.appendChild(renderer.view);\nticker.add(function (time) {\n renderer.render(stage);\n});", "// Or you can just update it manually.\nticker.autoStart = false;\nticker.stop();\nfunction animate(time) {\n ticker.update(time);\n renderer.render(stage);\n requestAnimationFrame(animate);\n}\nanimate(performance.now());" ], "type": { "names": [ "PIXI.ticker.Ticker" ] }, "memberof": "PIXI.ticker", "name": "shared", "longname": "PIXI.ticker.shared", "kind": "constant", "scope": "static", "___id": "T000002R011139", "___s": true, "filepath": "core\\ticker\\index.js" }