UNPKG

scrawl-canvas

Version:
56 lines (44 loc) 2.03 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Demo Canvas 046</title> <link href="css/normalize.css" rel="stylesheet" /> <link href="css/tests.css" rel="stylesheet" /> <style> canvas { margin: 0 auto; } img { display: none; } </style> </head> <body> <h1><a href="index.html">Scrawl-canvas v8</a> - Canvas test 046</h1> <h2>Kill cycles for Cell, Group, Tween/Ticker, Picture and Asset objects, and Picture source elements in the DOM</h2> <canvas id="mycanvas" width="400" height="400" data-scrawl-canvas data-base-clear-alpha="0.985" ></canvas> <p id="reportmessage"></p> <div class="testinfo"> <h4>Test purpose</h4> <p>The main purpose of this demo is to check that we can create cells, groups and entitys on the fly, grab an image of their display and then remove them; then create a Picture entity to display the captured image, and a Tween object that will animate the entity and destroy itself and the entity when it completes. As part of its destruction, the Tween will generate a new smoke ring.</p> <ul> <li>Check that additional Cells and Groups are created and destroyed - if the smoke ring shows, but no additional Cells/Groups are listed, then things are working.</li> <li>Check that assets, entitys and tweens are listed only while active, and are removed from the library when the associated Tween completes its cycle.</li> <li>Check also that the generated &lt;img> elements are removed from the DOM.</li> <li>Check that the animation halts whenever the browser page loses focus (for whatever reason), and restarts whenever it regains focus.</li> </ul> <p><b>Touch test:</b> not required</p> <p><a href="../docs/demo/canvas-046.html">Annotated code</a></p> </div> <script src="canvas-046.js" type="module"></script> </body> </html>