scrawl-canvas
Version:
Version 8.9.4 - 19 Nov 2022
57 lines (42 loc) • 1.83 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 Canvas 044</title>
<link href="css/normalize.css" rel="stylesheet" />
<link href="css/tests.css" rel="stylesheet" />
<style>
canvas {
margin: 0 auto 1em;
}
</style>
</head>
<body>
<h1><a href="index.html">Scrawl-canvas v8</a> - Canvas test 044</h1>
<h2>Building more complex patterns</h2>
<h3>The entitys are draggable</h3>
<canvas
id="mycanvas"
width="600"
height="400"
data-scrawl-canvas
data-base-background-color="azure"
></canvas>
<p id="reportmessage"></p>
<div class="testinfo">
<h4>Test purpose</h4>
<ul>
<li>STEP 1. We define a gradient, then apply it to some Blocks we create in a new canvas Cell. This gives us a more interesting gradient pattern than the default 'linear' and 'radial' gradients supplied by the Canvas API</li>
<li>STEP 2. Apply a Noise-based displacement filter to our pattern Cell. We can then animate this filter to make it more interesting</li>
<li>STEP 3. We are now in a position where we can use our Cells as pattern fills for some SC entitys.</li>
<li>STEP 4. If we want, we can add some color-based filters to our entitys, to give our pattern a different look.</li>
<li>STEP 5. There's one additional thing we can do with our Cell-based pattern - pass it into a Pattern object where we can warp and resize it. Then we can apply it to entitys via the Pattern object.</li>
</ul>
<p><b>Touch test:</b> should work as expected</p>
<p><a href="../docs/demo/canvas-044.html">Annotated code</a></p>
</div>
<script src="canvas-044.js" type="module"></script>
</body>
</html>