scrawl-canvas
Version:
Version 8.9.4 - 19 Nov 2022
45 lines (36 loc) • 1.74 kB
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 Packets 001</title>
<link href="css/normalize.css" rel="stylesheet" />
<link href="css/tests.css" rel="stylesheet" />
</head>
<body>
<h1><a href="index.html">Scrawl-canvas v8</a> - Packets test 001</h1>
<h2>Save and load Scrawl-canvas entity using text packets</h2>
<canvas
id="mycanvas"
width="600"
height="600"
data-scrawl-canvas
></canvas>
<p id="reportmessage"></p>
<div class="testinfo">
<h4>Test purpose</h4>
<ol>
<li>Create a block entity - including functionality to react to mouse enter/leave movements and an anchor which is triggered following a mouse click on the block</li>
<li>Create text packets of the block, using various arguments for the block's saveAsPacket() function</li>
<li>Delete the block (using the block.deregister() function)</li>
<li>Attempt to recreate the block from one of the text packets previously saved</li>
<li>Attempt to update the reconstituted block using a packet file downloaded from the server</li>
<li>Attempt to update the block using a second packet file which includes an instruction to remove the block's anchor functionality.</li>
</ol>
<p>Note: step 3 starts within a second of the demo loading; step 5 takes place 5 seconds into the demo; step 6 happens a further 5 seconds later. Results of the tests will print out in the browser's console. </p>
<p><a href="../docs/demo/packets-001.html">Annotated code</a></p>
</div>
<script src="packets-001.js" type="module"></script>
</body>
</html>