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

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

421. 请问老师为什么我按照官网的实例播放音频没反应呢? [ 77%]

...; soundButton.y = (Laya.stage.height - soundButton.height) / 2; Laya.stage.addChild(soundButton); //创建一个Sprite充当音乐播放按钮 var musicButton = createButton("播放音乐"); musicButton.x = soundButton.x + gap + soundButton.width; musicButton.y = soundButton.y; Laya.stage.addChild(m...

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

422. 动画-图集动画 [ 77%]

...ght / 2); ani.pos(Laya.stage.width / 2, Laya.stage.height / 2); Laya.stage.addChild(ani); } })();module laya { import Animation = Laya.Animation; import Stage = Laya.Stage; import Rectangle = Laya.Rectangle; import Loader = Laya.Loader; import Browser = Laya.Browser; import WebGL = Laya.WebGL; expor...

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

423. Sprite-旋转缩放 [ 77%]

...8"; this.showApe(); } showApe() { this.ape = new Laya.Sprite(); Laya.stage.addChild(this.ape); this.ape.loadImage("res/apes/monkey2.png"); this.ape.pivot(55, 72); // this.ape.pos( Laya.stage.width / 2, Laya.stage.height / 2); this.ape.x = Laya.stage.width / 2; this.ape.y = Laya.stage.height / 2; thi...

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

424. 滤镜-模糊滤镜 [ 77%]

...ateApe() { const Sprite = Laya.Sprite; this.ape = new Sprite(); Laya.stage.addChild(this.ape); let texture = Laya.loader.getRes(apePath); this.ape.graphics.drawTexture(texture); this.ape.x = (Laya.stage.width - texture.width) / 2; this.ape.y = (Laya.stage.height - texture.height) / 2; } applayFilter...

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

425. 为什么会出现报错 ani not found:ufo1_down [ 77%]

...悲剧 this.bg = new BackGround(); // 把背景添加到舞台 Laya.stage.addChild(this.bg); // 加载图集资源 Laya.loader.load("res/atlas/war.json",Laya.Handler.create(this,onLoaded),null,Laya.Loader.ATLAS); })(); function onLoaded(){ // 创建一个主角 this.hero = new Role(); // 初始化...

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

426. (实现手指控制模型的缩放旋转)触控可以识别 但是导入的模型没有根据触控反应 [ 76%]

...e)); } onComplete(){ //创建场景         var scene = Laya.stage.addChild(new Laya.Scene3D());         //创建相机         var camera = new Laya.Camera(0, 0.1, 100);         scene.addChild(camera);         //设置相机的名称         camera.na...

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

427. 分享:Dragonbones/Spine的换肤操作 [ 76%]

...ton.scale(0.5,0.5);//动画缩放为原始状态的二分之一 Laya.stage.addChild(skeleton);//添加动画至舞台,这时候运行,动画已经可以播放了 createButton();//创建一个按钮,用来切换皮肤使用 } private function createButton():void { var btn:Sprite=new Sprite();//...

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

428. UI-Label [ 76%]

...label.stroke = STROKE_WIDTH; label.strokeColor = strokeColor; } Laya.stage.addChild(label); return label; } })();module laya { import Stage = Laya.Stage; import Label = Laya.Label; import WebGL = Laya.WebGL; export class UI_Label { constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(...

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

429. 鼠标交互-鼠标交互 [ 76%]

...stage.width - 200) / 2; rect.y = (Laya.stage.height - 200) / 2; Laya.stage.addChild(rect); //增加鼠标事件 rect.on(Event.MOUSE_DOWN, this, this.mouseHandler); rect.on(Event.MOUSE_UP, this, this.mouseHandler); rect.on(Event.CLICK, this, this.mouseHandler); rect.on(Event.RIGHT_MOUSE_DOWN, this, t...

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

430. 粒子-粒子演示1 [ 76%]

...建 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_T1();module laya { import Stage = Laya.Stage; imp...

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