iwmlib/lib/pixi/progress.html

81 lines
2.8 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html>
2019-03-21 09:57:27 +01:00
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
2019-03-21 09:57:27 +01:00
<title>PIXI Progress</title>
2019-03-21 09:57:27 +01:00
<link rel="stylesheet" href="../3rdparty/highlight/styles/default.css" />
<link rel="stylesheet" href="../../css/doctest.css" />
2019-03-21 09:57:27 +01:00
<script src="../3rdparty/highlight/highlight.pack.js"></script>
<script src="../../dist/iwmlib.3rdparty.js"></script>
2019-03-21 09:57:27 +01:00
<script src="../../dist/iwmlib.js"></script>
<script src="../../dist/iwmlib.pixi.js"></script>
</head>
<body onload="Doctest.run()">
<h1><a href="../index.html">lib.</a><a href="index.html">pixi.</a>Progress</h1>
<p>A progress bar can be used to show a user how far along he/she is in a process.</p>
2019-03-21 09:57:27 +01:00
<h2>Example 1</h2>
<p>Let's look at the progress bar example:</p>
<br />
<canvas id="canvas" class="interactive"></canvas>
<p>
What you should see: When the page finished loading, a progress bar should overlay the PixiJS application.
</p>
<script class="doctest">
const app = new PIXIApp({
view: canvas,
width: 900,
height: 250,
transparent: false
})
.setup()
.run()
2019-03-21 09:57:27 +01:00
let progress1 = new Progress({
app: app
})
2019-03-21 09:57:27 +01:00
app.scene.addChild(progress1)
2019-03-21 09:57:27 +01:00
setTimeout(() => (progress1.progress = 10), 500)
setTimeout(() => (progress1.progress = 20), 800)
setTimeout(() => (progress1.progress = 50), 900)
setTimeout(() => (progress1.progress = 80), 1500)
setTimeout(() => (progress1.progress = 100), 1700)
</script>
2019-03-21 09:57:27 +01:00
<h2>Example 2</h2>
<canvas id="canvas2" class="interactive"></canvas>
<p>
What you should see: When the page finished loading, a progress bar should overlay the PixiJS application.
</p>
<script class="doctest">
const app2 = new PIXIApp({
view: canvas2,
width: 900,
height: 250,
transparent: false,
progress: {
height: 20,
fillActive: 0xe7bc51,
margin: 200
}
})
.setup()
.run()
2019-03-21 09:57:27 +01:00
setTimeout(() => app2.progress(10), 1000)
setTimeout(() => app2.progress(30), 2000)
setTimeout(() => app2.progress(35), 2300)
setTimeout(() => app2.progress(50), 2800)
setTimeout(() => app2.progress(60), 3500)
setTimeout(() => app2.progress(90), 4500)
setTimeout(() => app2.progress(100), 5000)
</script>
</body>
</html>