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

大约有 490 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0091 秒)

111. 圆形的头像怎么实现? [ 72%]

...aphics.drawCircle(88, 86, 40, 'transparent');   var tx = new Sprite(); tx.loadImage(PATH + 'tx.jpg'); tx.scale(0.3,0.3); this.addChild(tx); tx.mask = point; 2017-09-28 0 2 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 发起人 qq408896436 相关问...

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

112. 鼠标交互-Hold [ 72%]

...prite = Laya.Sprite, Event = Laya.Event; this.ape = new Sprite(); this.ape.loadImage(apePath); let texture = Laya.loader.getRes(apePath); this.ape.pivot(texture.width / 2, texture.height / 2); this.ape.pos(Laya.stage.width / 2, Laya.stage.height / 2); this.ape.scale(0.8, 0.8); Laya.stage.addChild(th...

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

113. CPU优化方式(JavaScript-2D进阶篇(JS)-性能优化) [ 71%]

...oSize是不可取的。如果设置了size,autoSize将不起效。 使用loadImage后获取宽高: ```javascript var sp=new Laya.Sprite(); sp.loadImage("res/apes/monkey2.png",0,0,0,0,Laya.Handler.create(this,function() { console.log(sp.width,sp.height); })); Laya.stage.addChild(sp); ``` loadImag...

来源: Laya2.0_文档 发布时间: 20210715

114. 滤镜-发光滤镜 [ 71%]

...yFilter(); } private createApe(): void { this.ape = new Sprite(); this.ape.loadImage(this.apePath); var texture: Texture = Laya.loader.getRes(this.apePath); this.ape.x = (Laya.stage.width - texture.width) / 2; this.ape.y = (Laya.stage.height - texture.height) / 2; Laya.stage.addChild(this.ape); } pr...

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

115. drawToCanvas无法截取到有子元素。 [ 71%]

...liqunyang 赞同来自: // test drawToCanvas const sp1 = new Sprite(); sp1.loadImage('bet/cheer_1_3.png'); const sp2 = new Sprite(); sp2.x = 100; sp2.loadImage('bet/cheer_1_4.png'); sp1.addChild(sp2); this.addChild(sp1); const htmlCanvas = sp1.drawToCanvas(640, 200, 0, 0); const canvas = htmlCanvas....

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

116. 关于闭包的问题 [ 71%]

...r z = 0; z < letterList.length; z++){ var letter = new Sprite(); letter.loadImage("../imgs/linkup/" + letterList[z] + ".png", (bg.width / letterList.length) * z, 0, bg.width / letterList.length, bg.height / 2); Laya.stage.addChild(letter); letter.on("click", this, (function(para){ console.log("z:...

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

117. 缓动-时间线 [ 71%]

... this.target = new Sprite(); Laya.stage.addChild(this.target); this.target.loadImage("res/apes/monkey2.png"); this.target.pivot(55, 72); this.target.pos(100,100); } createTimerLine() { const TimeLine = Laya.TimeLine, Event = Laya.Event; this.timeLine = new TimeLine(); // addLabel(label:String, offse...

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

118. 飞机大战出现的问题注册了类New的时候报错未定义 [ 70%]

...背景1 this.bg1 = new Laya.Sprite(); //加载并显示背景图 this.bg1.loadImage("war/bc.png"); //把背景1放在容器中 this.addChild(this.bg1); //创建游戏背景2 this.bg2 = new Laya.Sprite(); //加载并显示背景图 this.bg2.loadImage("war/bc.png"); //更改背景2,放在背景1的...

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

119. 图片遮罩大小跟设置不一致 [ 70%]

...olor = "#232628"; showApe(); })(); function showApe() { // 方法1:使用loadImage var ape = new Sprite(); Laya.stage.addChild(ape); ape.loadImage("../../res/apes/monkey3.png"); // 方法2:使用drawTexture Laya.loader.load("https://s2.d2scdn.com/2017/12/ ... ot%3B, Handler.create(this, function...

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

120. CPU优化方式(TypeScript-2D进阶篇(TS)-性能优化) [ 70%]

...oSize是不可取的。如果设置了size,autoSize将不起效。 使用loadImage后获取宽高: ```typescript var sp=new Laya.Sprite(); sp.loadImage("res/apes/monkey2.png",0,0,0,0,Laya.Handler.create(this,function() { console.log(sp.width,sp.height); })); Laya.stage.addChild(sp); ``` loadImag...

来源: Laya2.0_文档 发布时间: 20210714