• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 44 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0052 秒)

1. js继承模式 [ 100%]

...function Class() { Class.super(this); // this定义.. this.init(); } Class.prototype.init = function() { console.log(this); }; return Class; })(); } var __extends = (this && this.__extends) || function(d, b) { for (var p in b) { (b.hasOwnProperty(p)) && (d[p] = b[p]); } function __()...

来源: Laya_社区 发布时间: 20170619

2. 运行总报TypeError: Object prototype may only be an Object or null: undefined [ 86%]

运行总报TypeError: Object prototype may only be an Object or null: undefined 我的例子只是简单的几个类继承,总是报这个异常,找了很久不没找到原因,工程见附件 TypeError: Object prototype may only be an Object or null: undefined at setPrototypeOf (<anonymou...

来源: Laya_社区 发布时间: 20170921

3. http无响应 [ 85%]

...View,"LoginView",_super); //设置继承关系 //初始化函数 LoginView.prototype.init = function () { //监听登录按钮按下事件 this.login.on(Laya.Event.CLICK,this,this.onButtonLogin); //忘记密码 this.wjmm.on(Laya.Event.CLICK,this,this.onLableWjmm); } //登录按钮响应函数 LoginV...

来源: Laya_社区 发布时间: 20170215

4. 【简单跑酷--JS版】---Lv.3 添加地板 [ 84%]

...Sprite Laya.class(Floor, "Floor", laya.display.Sprite); var _proto = Floor.prototype; _proto.init = function(type){ //创建一个帧循环处理函数 Laya.timer.frameLoop(1, this, this.onLoop); } //在地板上面添加物品 _proto.addItem = function(){ } _proto.onLoop = function(){ } })(); 因...

来源: Laya_社区 发布时间: 20160728

5. 照着官方文档写的 Dialog 报错? [ 81%]

...档写的 Dialog 报错? var LoadResource = function () { LoadResource.prototype.init = function () { this._container = new Sprite(); Laya.stage.addChild(this._container); Laya.loader.load(["../bin/res/ui/progressBar.png", "../bin/res/ui/progressBar$bar.png"], Handler.create(this, this.onPreloaded...

来源: Laya_社区 发布时间: 20200924

6. 分享一个虚拟摇杆,比较粗糙,没做优化 [ 80%]

...是否移动,有点多余了 //初始化你预先设置的参数 ModeKey.prototype.init = function () { console.log(this.moveKey, this.layer, this.moveMax) this.moveKey.on(Laya.Event.MOUSE_DOWN, this, this.downFun); //记录一开始小圆点的位置,方便鼠标弹起的时候自动返回开...

来源: Laya_社区 发布时间: 20171030

7. 【简单跑酷--JS版】---Lv.5 玩家踩地板 [ 77%]

...Sprite Laya.class(Floor, "Floor", laya.display.Sprite); var _proto = Floor.prototype; /** * type int 1->地板默认宽度 other->随机宽度 */ _proto.init = function(type){ this.maxRight = 0; //如果不开启autoSize 父容器的宽度和高度无法获取 this.autoSize = true; //初始化...

来源: Laya_社区 发布时间: 20160801

8. 【简单跑酷--JS版】---Lv.6 终篇 [ 77%]

...ype_speed"; //Hp Laya.class(Hp,"Hp", laya.display.Sprite); var _proto = Hp.prototype; _proto.init = function(type){ this.width = 180; this.height = 21; var texture1 = Laya.loader.getRes("res/hp_bg.png"); var texture2; switch (type) { case Hp.HP_TYPE_ENERGY: texture2 = Laya.loader.getRes("res/en_bar....

来源: Laya_社区 发布时间: 20160803

9. 【简单跑酷--JS版】---Lv.2 类之间的引用以及背景滚动实现 [ 75%]

...rite Laya.class(RunGame,"RunGame", laya.display.Sprite); //定义RunGame的prototype var _proto = RunGame.prototype; //初始化 _proto.init = function(){ console.log('RunGame Init'); } })(); 此处我们要说一下  Laya.class(RunGame,"RunGame", laya.display.Sprite); 这是JS特有的继承写法...

来源: Laya_社区 发布时间: 20160722

10. HTMLDIVElement设置innerHTML时报错 [ 74%]

... if (this._width)return this._width; return this.contextWidth; },[b]_super.prototype._$set_width[/b]);此次出问题的版本为/** *获取对象的宽 */ __getset(0,__proto,'width',function(){ if (this._width)return this._width; return this.contextWidth; },[b]function(value){ var changed=false; ch...

来源: Laya_社区 发布时间: 20170620