You've already forked Pandona-Engine
初始化提交
This commit is contained in:
37
template-example/sence/sence1/index.pe
Normal file
37
template-example/sence/sence1/index.pe
Normal file
@@ -0,0 +1,37 @@
|
||||
<sence>
|
||||
<sprite class="test-sprite" @click="console.log('Sprite clicked!')"></sprite>
|
||||
<box class="test-box">Hello PE!</box>
|
||||
<text class="test-text">Welcome to PE Engine</text>
|
||||
<box for="{label,action} in boxList" @click="onMenuClick(action)" class="menu-item">
|
||||
{{ label }}
|
||||
</box>
|
||||
<text for="{label} in boxList">
|
||||
{{label}}
|
||||
</text>
|
||||
</sence>
|
||||
|
||||
<script>
|
||||
const boxList = [{
|
||||
label:"开始游戏",
|
||||
action:"start"
|
||||
},
|
||||
{
|
||||
label:"读取存档",
|
||||
action:"loadgame"
|
||||
}]
|
||||
|
||||
let count = 0
|
||||
|
||||
onLoad(()=>{
|
||||
console.log("Scene loaded - Lifecycle callback working!")
|
||||
})
|
||||
|
||||
onShow(()=>{
|
||||
console.log("Scene shown - Lifecycle callback working!")
|
||||
})
|
||||
|
||||
function onMenuClick(act){
|
||||
count++;
|
||||
console.log("Menu action:", act, count)
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user