Added Scrollview.
This commit is contained in:
+25
-29
@@ -13,7 +13,6 @@
|
||||
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||
<script src="../../dist/iwmlib.js"></script>
|
||||
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||
<!-- <script src="./scrollbox.min.js"></script> -->
|
||||
</head>
|
||||
<body onload="Doctest.run()">
|
||||
<h1>Scrollview</h1>
|
||||
@@ -37,38 +36,35 @@
|
||||
const app = new PIXIApp({
|
||||
view: canvas,
|
||||
width: 900,
|
||||
height: 250,
|
||||
height: 400,
|
||||
transparent: false
|
||||
}).setup().run()
|
||||
|
||||
// let scrollview1 = new Scrollview({
|
||||
// x: 10,
|
||||
// y: 20
|
||||
// })
|
||||
app.loader
|
||||
.add('elephant1', './assets/elephant-1.jpg')
|
||||
.add('elephant2', './assets/elephant-2.jpg')
|
||||
.add('elephant3', './assets/elephant-3.jpg')
|
||||
.load((loader, resources) => {
|
||||
const sprite1 = new PIXI.Sprite(resources.elephant1.texture)
|
||||
const sprite2 = new PIXI.Sprite(resources.elephant2.texture)
|
||||
const sprite3 = new PIXI.Sprite(resources.elephant3.texture)
|
||||
|
||||
// let scrollview2 = new Scrollview({
|
||||
// x: 90,
|
||||
// y: 20,
|
||||
// fill: 0xfd355a,
|
||||
// fillActive: 0x5954d3,
|
||||
// controlFill: 0xfecd2d,
|
||||
// controlFillActive: 0xfd413b,
|
||||
// strokeActiveWidth: 4,
|
||||
// controlStrokeActive: 0x50d968,
|
||||
// controlStrokeActiveWidth: 12,
|
||||
// controlStrokeActiveAlpha: .8,
|
||||
// tooltip: 'Dies ist ein Switch'
|
||||
// })
|
||||
const scrollview1 = new Scrollview({boxWidth: 300, boxHeight: 180})
|
||||
scrollview1.content.addChild(sprite1)
|
||||
app.scene.addChild(scrollview1)
|
||||
|
||||
// const scrollbox = new PIXI.extras.Scrollbox({boxWidth: 500, boxHeight: 200})
|
||||
// scrollbox.x = 70
|
||||
// scrollbox.y = 30
|
||||
|
||||
// const sprite = new PIXI.Sprite(resources.fulda.texture)
|
||||
// sprite.scale.set(.5, .5)
|
||||
// scrollbox.content.addChild(sprite)
|
||||
// app.stage.addChild(scrollbox)
|
||||
|
||||
// app.scene.addChild(switch1, switch2)
|
||||
const scrollview2 = new Scrollview({boxWidth: 300, boxHeight: 300})
|
||||
scrollview2.x = 500
|
||||
scrollview2.y = 30
|
||||
sprite2.x = 40
|
||||
sprite2.y = 40
|
||||
sprite2.scale.set(.3, .3)
|
||||
sprite3.x = 60
|
||||
sprite3.y = 100
|
||||
sprite3.alpha = .6
|
||||
sprite3.scale.set(.5, .5)
|
||||
scrollview2.content.addChild(sprite2, sprite3)
|
||||
app.scene.addChild(scrollview2)
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user