iwmlib/lib/pixi/message.html

82 lines
2.8 KiB
HTML
Raw 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 Message</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>Message</h1>
<p>
A message box is a timed popup window. By default, the message window appears in the upper right corner and
disappears after 5 seconds.
</p>
<p><a href="../../doc/out/Message.html">JavaScript API</a></p>
<p>Let's look at some message examples:</p>
<br />
<canvas id="canvas" class="interactive"></canvas>
<p>What you should see: Two buttons which start message windows.</p>
<script class="doctest">
const app = new PIXIApp({
view: canvas,
width: 900,
height: 250
})
.setup()
.run()
2019-03-21 09:57:27 +01:00
let button1 = new Button({
x: 0,
label: 'Default message',
action: (e) => {
const message = new Message({
app: app,
header: 'Dies ist die Überschrift',
content: 'Und dies ist der Text der Meldung.'
})
app.scene.addChild(message)
}
})
2019-03-21 09:57:27 +01:00
let button2 = new Button({
x: 170,
label: 'Bottom-centered message',
action: (e) => {
const message = new Message({
app: app,
content: 'Diese Nachricht hat nur einen Text.',
autoClose: false,
closeButton: true,
align: 'center',
verticalAlign: 'bottom'
})
app.scene.addChild(message)
}
})
2019-03-21 09:57:27 +01:00
let button3 = new Button({
x: 0,
y: 60,
label: 'Message from PixiApp',
action: (e) => {
let message = app.message({
content: 'Diese Nachricht verschwindet gleich wieder.'
})
}
})
2019-03-21 09:57:27 +01:00
app.scene.addChild(button1, button2)
app.scene.addChild(button3)
</script>
</body>
</html>