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

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

321. 安卓打包之后动画老是喜欢出错 [ 68%]

...,我希望可以控制下,比如这样: 在18522行可以改成if (!this._target || this._target.destroyed),因为有些时候动画被destroy了,但是这个确莫名其妙还在调,就导致各种报错。。。。 附件 : --> 2017-06-15 添加评论 免费帖 --> 分享 微博 QZONE ...

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

322. 屏幕适配-屏幕适配 [ 68%]

...e(); bg.skin = "res/bg.jpg"; Laya.stage.addChild(bg); //实例一个文本 this.txt = new Text(); this.txt.text = "点击我切换适配模式(noscale)"; this.txt.bold = true; this.txt.pos(0, 200); this.txt.fontSize = 30; this.txt.on("click", this, this.onTxtClick); Laya.stage.addChild(this.txt); //...

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

323. 2D物理-碰撞事件与传感器 [ 68%]

...开发更高效。class Physics_Physics_CollisionEvent { constructor() { this.count = 7; this.bodys = []; this.touching = []; Laya.Config.isAntialias = true; Laya.Laya.init(1200, 700, Laya.WebGL); Laya.Stat.show(); Laya.Physics.enable(); Laya.PhysicsDebugDraw.enable(); Laya.Laya.stage.alignV = Laya....

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

324. LayaAir和原生DOM交互(ActionScript-2D进阶篇(AS3)-扩展模块) [ 68%]

...ring ="http://layabox.com/"; qrcode.makeCode(url); Laya.stage.once("click",this,clickHandler); qrcodeSp = new Sprite(); Laya.stage.addChild(qrcodeSp); } private function clickHandler():void { var url:String = qrcode._oDrawing._elImage.src;//获取,注意这里是异步的,开发者可以加个...

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

325. 物理引擎-布 [ 68%]

...)(); function setup() { initMatter(); initWorld(); Laya.stage.on("resize", this, onResize); } function initMatter() { var gameWorld = new Sprite(); Laya.stage.addChild(gameWorld); // 初始化物理引擎 engine = Matter.Engine.create( { enableSleeping: true }); Matter.Engine.run(engine); var render...

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

326. Sprite-新手引导 [ 68%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.createPage(); } createPage() { const Sprite = Laya.Sprite; // 绘制底图 gameContainer = new Sprite(); Laya.stage.addChild(gameContainer); gameContainer.loadImage("res/guide/crazy_snowball.png"); gameContainer.on(Laya....

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

327. Sprite-新手引导 [ 68%]

...= "bitmap"; Laya.stage.addChild(guideContainer); gameContainer.on("click", this, nextStep); //绘制遮罩区,含透明度,可见游戏背景 var maskArea = new Sprite(); maskArea.alpha = 0.5; maskArea.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000"); guideContainer.addChi...

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

328. 动画-图集动画 [ 68%]

...ya.stage.bgColor = "#232628"; Laya.loader.load(AniConfPath, Handler.create(this, createAnimation), null, Loader.ATLAS); })(); function createAnimation() { var ani = new Animation(); ani.loadAtlas(AniConfPath); // 加载图集动画 ani.interval = 30; // 设置播放间隔(单位:毫秒) ani.in...

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

329. 区块地图-带动画的地图 [ 68%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.createMap(); } private createMap(): void { this.tiledMap = new TiledMap(); this.tiledMap.createMap("../../res/tiledMap/orthogonal-test-movelayer.json", new Rectangle(0, 0, Laya.stage.width, Laya.stage.height), null); } }...

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

330. 鼠标交互-修正交互区域 [ 68%]

...leMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { this.buildWorld(); this.createLogger(); } buildWorld() { const Event = Laya.Event; this.createCoralRect(); this.createDeepSkyblueRect(); this.createDarkOrchidRect(); // 设置舞台 Laya.stage.name =...

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