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

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

61. UI-List [ 77%]

...项目开发更高效。const WID = 373, HEI = 85; const Box = Laya.Box; class Item extends Box { constructor(){ super(); const Image = Laya.Image; this.size(WID, HEI); this.img = new Image(); this.addChild(this.img); } setImg(src) { this.img.skin = src; } } class UI_List { constructor() { const Bro...

来源: Laya2.0_示例 发布时间: 20240929

62. 音频节点 · LayaAir3.0文档 · LAYABOX [ 77%]

...下面给出一个示例代码,实现脚本控制SoundNode: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.SoundNode }) public sound: Laya.SoundNode; constructor() { super(); } /** * 组件被...

来源: Laya3.0_文档 发布时间: 20230628

63. 绘制图形的BUG [ 77%]

...kage ui.test { import laya.display.Sprite; import laya.utils.Tween; public class MyBox extends Sprite { private var _shape:Sprite; public function MyBox() { super(); graphics.drawRect(0,0,200,200,"#00ff00"); _shape=new Sprite(); _shape.graphics.drawCircle(0,0,20,"#ff0000"); addChild(_shape); //加...

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

64. "Background is not defined"怎么会没定义呢???求救 [ 76%]

... this.bg1.loadImage("res/background.png"); this.addChild(this.bg1); } Laya.class(Background,"Background",_super); window.Background=Background; return Background; })(Laya.Sprite); 2017-04-20 0 2 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 发起人...

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

65. 想用js写一个什么也不继承的类,但每次实例化这个类的时候会报错,是不是这个类写得不对呀 [ 76%]

...);         console.log("执行测试构造函数"); } //注册类 Laya.class(Test,"Test",_super); //获取执行域 var _proto = Test.prototype; //_proto. return Test; })(); 2018-06-05 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链...

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

66. 官方视频教程中飞机大战 "this.addChild is not a function" [ 76%]

... this.bg1.loadImage("war/background.png"); this.addChild(this.bg1); } Laya.class(BackGround,"BackGround",_super); return BackGround; })(Laya.Sprite);报错 "TypeError: this.addChild is not a function    at BackGround (file:///D:/test/laya/myLaya/src/BackGround.js:6:14)    at Game (file:///D:/tes...

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

67. TypeScript语法问题,泛型 [ 76%]

...但是写了很多遍没成功,有人会吗?下面是C#代码 public class Class1<T> where T : class, new() { private static T instance; public static T GetInstence() { if (null == instance) { instance = new T(); } return instance; } } 这样我在其他地方,继承Class1,就可以直...

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

68. @regClass编译报错! [ 76%]

@regClass编译报错! 去掉CtrBase里的@regClass 就不报错! 再或者CtrBase 不引用funzzzzz 或者 funzzzzz不引用MachineCtrl 也不会报错。已经是最精简的就三个类,每个一行代码。上网查 升级了webpack也没用。   写了构造函数也没用 bundle编译...

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

69. 关于环形进度条,进度不能重置问题 [ 76%]

...say.width/2, "#00ffff"); this.circle.blendMode = "destination-out"; } Laya.class(IndexView,"IndexView",_super); IndexView.prototype.loadProgress = function(){ this.box.addChild(this.circle); if(this.angle <= 360){ this.angle+=12; this.draw.graphics.drawPie(this.say.width/2, this.say.height/2, thi...

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

70. ts项目 模块问题 [ 76%]

ts项目 模块问题 b文件写了个class ,怎么在a文件new class? export 显示未定义,require也用不了   //b文件 export default class player extends Laya.Sprite { constructor() { super(); this.pivot(this.width / 2, this.height / 2); this.graphics.drawRect(0, 0, this._size, this...

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