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

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

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

....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)); }; LoadResource.prototype.onPreloaded = function () { this.initLoadD...

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

212. 滤镜-发光滤镜 [ 86%]

...e.width) / 2; ape.y = (Laya.stage.height - texture.height) / 2; Laya.stage.addChild(ape); } function applayFilter() { //创建一个发光滤镜 var glowFilter = new GlowFilter("#ffff00", 10, 0, 0); //设置滤镜集合为发光滤镜 ape.filters = [glowFilter]; } })();module laya { import Sprite = ...

来源: Laya_示例 发布时间: 20251209

213. Sprite-切换纹理 [ 86%]

...Loaded)); })(); function onAssetsLoaded() { ape = new Sprite(); Laya.stage.addChild(ape); ape.pivot(55, 72); ape.pos(Laya.stage.width / 2, Laya.stage.height / 2); // 显示默认纹理 switchTexture(); ape.on("click", this, switchTexture); } function switchTexture() { var textureUrl = (flag = !flag)...

来源: Laya_示例 发布时间: 20251209

214. UI-Label [ 86%]

... = Laya.Label; const STROKE_WIDTH = 4; var label = new Label(); Laya.stage.addChild(label); label.font = "Microsoft YaHei"; label.text = "SAMPLE DEMO"; label.fontSize = 30; label.color = color; if (strokeColor) { label.stroke = STROKE_WIDTH; label.strokeColor = strokeColor; } return label; } } new U...

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

215. 粒子-粒子演示2 [ 86%]

...建 Particle2D 实例 let partIns = new Particle2D(settings); Laya.stage.addChild(partIns); // 开始发射粒子 partIns.emitter.start(); // 播放 partIns.play(); partIns.x = Laya.stage.width / 2; partIns.y = Laya.stage.height / 2; } } new Particle_T2();module laya { import Stage = Laya.Stage; imp...

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

216. 粒子-粒子演示3 [ 86%]

...建 Particle2D 实例 let partIns = new Particle2D(settings); Laya.stage.addChild(partIns); // 开始发射粒子 partIns.emitter.start(); // 播放 partIns.play(); partIns.x = Laya.stage.width / 2; partIns.y = Laya.stage.height / 2; } } new Particle_T3();module laya { import Stage = Laya.Stage; imp...

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

217. 鼠标交互-自定义事件 [ 86%]

...age.width / 2; sp.y = Laya.stage.height / 2; sp.size(200, 200); Laya.stage.addChild(sp); sp.on(ROTATE, this, onRotate); // 侦听自定义的事件 sp.on(Event.CLICK, this, onSpriteClick); } function onSpriteClick(e) { var randomAngle = Math.random() * 180; //发送自定义事件 sp.event(ROTATE, [...

来源: Laya_示例 发布时间: 20251209

218. 显示与切换图片(TypeScript-LayaAir基础篇(TS)-位图) [ 86%]

...用loadImage var ape: Sprite = new Sprite(); ape.pos(100,50); Laya.stage.addChild(ape); ape.loadImage("../../res/apes/monkey3.png"); } } } new laya.Sprite_DisplayImage(); ``` 在示例代码里,“`100,50`”是图片的显示坐标信息。示例代码运行效果如图2-1所示: ![图2-1](img/...

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

219. HtmlDivElement宽度设置错误 [ 86%]

...new Laya.Sprite(); this.bg.graphics.drawRect(0, 0, 200, 200, '#ccc'); this.addChild(this.bg); this.htmlTxt = new Laya.HTMLDivElement(); this.htmlTxt.style.fontSize = 20; this.htmlTxt.style.width = 200; this.htmlTxt.style.borderColor = '#000'; this.htmlTxt.style.align = 'center'; this.htmlTxt.innerHT...

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

220. List 组件做的手风琴Demo [ 86%]

...BOX类         list.vScrollBarSkin ="";         Laya.stage.addChild(list);         list.array =this.arr;         list.renderHandler =new Laya.Handler(this,this.updateItem);         this.listArr.push(list); //----------------------------------------------------...

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