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

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

1. 缓动-时间线 [ 100%]

...OWN, this, this.keyDown); } createApe() { const Sprite = Laya.Sprite; 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.E...

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

2. UI-RefreshList [ 96%]

...ind(){ return this.scrollBarIsStop; } onListMouse(e, index){ console.log(e.target.name); if (e.type == Event.MOUSE_DOWN) { this.mouseDown = true; //如果单元格已经展开,则先恢复 if (this.itemIsOpen) { this.itemIsOpen = false; this.itemOpenId = -1; Tween.to(this.openedItem, { "x": 0 }, 5...

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

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

....onResize); } onBoyClick(e) { //点击后小人会放大缩小 let boy = e.target; if (boy.scaleX === 1) { boy.scale(1.2, 1.2); } else { boy.scale(1, 1); } } onTxtClick(e) { //点击后切换适配模式 e.stopPropagation(); index++; if (index >= modes.length) index = 0; Laya.stage.scaleMode = modes...

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

4. 鼠标交互-修正交互区域 [ 83%]

...ger); } /**侦听处理方法*/ onDown(e) { logger.text += "点击 - " + e.target.name + "\n"; } } new Interaction_FixInteractiveRegion();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Text = Laya.Text; import Event = Laya.Event; import Browser = Laya.Browser; import We...

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

5. Sprite-屏幕截图 [ 72%]

...idth,this.drawSp.height,"#ff0000"); } private _onclick(e:Event){ switch (e.target.name) { case this.nameArr[0]: var base64Url:string = this._canvas.toDataURL("image/png",1); this.drawImage.skin = base64Url; break; case this.nameArr[1]: var text:Texture = Laya.stage.drawToTexture(Browser.clientWidth,...

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

6. 2D物理-碰撞过滤器 [ 69%]

....stage.on(Event.MOUSE_OUT, this, this.mouseUp); // let rigidbody = this.curTarget.getComponent(RigidBody); // rigidbody.type = "kinematic"; } mouseMove(e) { let movementX = e.nativeEvent.movementX; let movementY = e.nativeEvent.movementY; this.preMovementX = movementX; this.preMovementY = movementY;...

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