摘要:const {ccclass, requireComponent} = cc._decorator; @ccclass @requireComponent(cc.Sprite) class SpriteCtrl extends cc.Component { // ... } https://docs
阅读全文
摘要:Cocos Creator 3.x import { Animation, error } from "cc"; export class AnimationUtil { /** * 播放动画到指定的sprite帧,并停止 * @param animation cc.Animation组件 * @p
阅读全文
摘要:const {ccclass, property} = cc._decorator; @ccclass export default class TestButton extends cc.Component{ private _button:cc.Button=null; protected on
阅读全文
摘要:startDisplayTimer(){ this.scheduleOnce(this.displayNumber,1); } displayNumber(){ this.startDisplayTimer(); } //test this.startDisplayTimer(); 由于在sched
阅读全文
摘要:```javascript // http://www.emanueleferonato.com/2011/08/05/slicing splitting and cutting objects with box2d part 4 using real graphics/ const EPSILON
阅读全文
摘要:```
//export class PhysicsCollider{ export class PhysicsCollider extends Collider{ ==================检查代码=======================
this.node.getComponent(cc.PhysicsBoxCollider);
==================检查代...
阅读全文
摘要:TypeScript中的set与get private _id:number; public get id():number{ return this._id; } public set id(value:number){//set:必须无返回值类型 this._id=value; } Inspec
阅读全文
摘要:使用以下代码在chrome中测试得出结果 1.cc.director.getVisibleSize();//获取运行场景的可见大小 _不理解,它和我用截图工具测量的不一样啊??_ 2.cc.director.getWinSize();//获取视图的大小,以点为单位 cc.director.getWi
阅读全文
摘要:在assets文件夹外新建xx.d.ts文件如:global.d.ts global.d.ts 就可以提示了
阅读全文