Files
sdk4_demo/example/爆炸效果.html
2025-07-03 15:12:58 +08:00

53 lines
992 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="../sdk/YJEarth.min.js"></script>
<script src="vue.js"></script>
<style>
body {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="app" class="fullSize">
</div>
</body>
</html>
<script>
new Vue({
el: "#app",
data: {
},
async mounted() {
await YJ.on()
this.createEarth()
},
methods: {
async createEarth() {
window.sdk = await new YJ.YJEarth("app")
let Draw = await new YJ.Draw.DrawPoint(sdk)
Draw.start((a, positions) => {
//爆炸效果
let explosion = new YJ.Obj.Explosion(sdk, {
position: positions
})
explosion.Dialog.confirmCallBack = (v) => {
console.log(v)
}
explosion.edit(true)
explosion.flyTo()
window.explosion = explosion
})
}
}
})
</script>