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

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

1. 鼠标交互-鼠标交互 [ 100%]

...leMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { this.createInteractiveTarget(); this.createLogger(); } createInteractiveTarget() { const Event = Laya.Event, Sprite = Laya.Sprite; let rect = new Sprite(); rect.graphics.drawRect(0, 0, 200, 200, "#D2...

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

2. 鼠标交互-鼠标交互 [ 99%]

... Laya.stage.addChild(rect); //增加鼠标事件 rect.on(Event.MOUSE_DOWN, this, mouseHandler); rect.on(Event.MOUSE_UP, this, mouseHandler); rect.on(Event.CLICK, this, mouseHandler); rect.on(Event.RIGHT_MOUSE_DOWN, this, mouseHandler); rect.on(Event.RIGHT_MOUSE_UP, this, mouseHandler); rect.on(Event...

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

3. 屏幕适配-屏幕适配 [ 96%]

...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_示例 发布时间: 20241117

4. 骨骼动画-适配版Spine [ 96%]

... var SpineTemplet = Laya.SpineTemplet; class SpineBinary { constructor() { this.aniPath = "res/bone/spineboy-pma.skel"; this.index = -1; Laya.init(Browser.width, Browser.height, WebGL); Laya.stage.scaleMode = Stage.SCALE_NOSCALE; Laya.stage.bgColor = "#232628"; Stat.show(); this.startFun(); } startF...

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

5. 区块地图-滚动地图 [ 96%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.createMap(); Laya.stage.on(Event.MOUSE_DOWN, this, this.mouseDown); Laya.stage.on(Event.MOUSE_UP, this, this.mouseUp); Stat.show(); } // 创建地图 createMap() { const TiledMap = Laya.TiledMap, Rectangle = Laya.Rectang...

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

6. 区块地图-滚动地图 [ 96%]

...tage.SCALE_FULL; Stat.show(); createMap(); Laya.stage.on(Event.MOUSE_DOWN, this, mouseDown); Laya.stage.on(Event.MOUSE_UP, this, mouseUp); })(); //创建地图 function createMap() { //创建地图对象 tiledMap = new TiledMap(); mX = mY = 0; //创建地图,适当的时候调用destory销毁地...

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

7. 骨骼动画-Spine事件 [ 96%]

... Laya.stage.bgColor = "#ffffff"; mLabelSprite = new Sprite(); Stat.show(); this.startFun(); } startFun() { const Templet = Laya.Templet, Event = Laya.Event; const mAniPath = "res/spine/spineRes6/alien.sk"; mFactory = new Templet(); mFactory.on(Event.COMPLETE, this, this.parseComplete); mFactory.on(E...

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

8. 调用动画结束on方法,报错this.zombieAnimator.on is not a function [ 96%]

调用动画结束on方法,报错this.zombieAnimator.on is not a function 创建官方示例3D Laya.Sprite3D.load("res/threeDimen/skinModel/Zombie/Zombie.lh", Laya.Handler.create(this, function(zombie:Laya.Sprite3D):void { scene.addChild(zombie); this.zombieAnimator = (zombie.getChildAt(0) as Lay...

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

9. 骨骼动画-Spine事件 [ 96%]

...spineRes6/alien.sk"; mFactory = new Templet(); mFactory.on(Event.COMPLETE, this, parseComplete); mFactory.on(Event.ERROR, this, onError); mFactory.loadAni(mAniPath); } function onError() { trace("error"); } function parseComplete() { //创建模式为1,可以启用换装 mArmature = mFactory.build...

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

10. 鼠标交互-双指旋转(多点触控) [ 96%]

...leMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { this.createSprite(); Laya.stage.on(Event.MOUSE_UP, this, this.onMouseUp); Laya.stage.on(Event.MOUSE_OUT, this, this.onMouseUp); } createSprite() { const Sprite = Laya.Sprite, Event = Laya.Event; let ...

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