mirror of
https://github.com/Leo501/CocosCreatorTutorial.git
synced 2026-06-01 06:59:21 +08:00
添加一个简单的新手引导时,只能点击某个区域
This commit is contained in:
30
GuideDemo/assets/Script/HelloWorld.js
Normal file
30
GuideDemo/assets/Script/HelloWorld.js
Normal file
@@ -0,0 +1,30 @@
|
||||
cc.Class({
|
||||
extends: cc.Component,
|
||||
|
||||
properties: {
|
||||
label: {
|
||||
default: null,
|
||||
type: cc.Label
|
||||
},
|
||||
// defaults, set visually when attaching this script to the Canvas
|
||||
text: 'Hello, World!'
|
||||
},
|
||||
|
||||
// use this for initialization
|
||||
onLoad: function () {
|
||||
this.label.string = this.text;
|
||||
},
|
||||
|
||||
onEventClicked_can() {
|
||||
console.log('onEventClicked_can');
|
||||
},
|
||||
|
||||
onEventClicked_no() {
|
||||
console.log('onEventClicked_no');
|
||||
},
|
||||
|
||||
// called every frame
|
||||
update: function (dt) {
|
||||
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user