
const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    @property(cc.Label)
    titleTextLabel: cc.Label = null;

    @property(cc.AudioSource)
    audioSource:cc.AudioSource = null;

    // onLoad () {}

    start () {
        this.audioSource.node.on(cc.Node.EventType.TOUCH_START,this.playSe,this);
        // cc.view.getFrameSize
    }
    /**
     * 设置标题文本
     * @param text 
     */
    setTittleText(text:string){
        this.titleTextLabel.string = text?text:"";
    }
    
    setAudioClip(ac:cc.AudioClip){
        this.audioSource.clip = ac;
    }

    playSe(){
        this.audioSource.play();
    }

    // update (dt) {}
}
