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

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

1. 动画-图集动画 [ 100%]

...nterval = 30; // 设置播放间隔(单位:毫秒) ani.index = 1; // 当前播放索引 ani.play(); // 播放图集动画 // 获取动画的边界信息 let bounds = ani.getGraphicBounds(); ani.pivot(bounds.width / 2, bounds.height / 2); ani.pos(Laya.stage.width / 2, Laya.stage.height / 2); } ...

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

2. UI-Tab [ 92%]

...t); Laya.stage.addChild(tab); return tab; } onSelect(index) { console.log("当前选择的标签页索引为 " + index); } } new UI_Tab();module laya { import Stage = Laya.Stage; import Tab = Laya.Tab; import Handler = Laya.Handler; import WebGL = Laya.WebGL; export class UI_Tab { private skins: Arr...

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

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

...og("mouse:", Laya.stage.mouseX, Laya.stage.mouseY); } onResize() { //输出当前适配模式下的stage大小 console.log("size:", Laya.stage.width, Laya.stage.height); } } new SmartScale_T();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Text = Laya.Text; import Event...

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

4. 输入设备-指南针 [ 89%]

...n(Event.CHANGE, this, this.onOrientationChange); } // 方位指示器指向当前所朝方位 createCompass() { const Sprite = Laya.Sprite; compassImg = new Sprite(); Laya.stage.addChild(compassImg); compassImg.loadImage(compassImgPath); compassImg.pivot(compassImg.width / 2, compassImg.height / 2);...

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

5. 输入设备-地图 [ 87%]

...(new BMap.Point(0,0)); map.addOverlay(marker); let label = new BMap.Label("当前位置", { offset: new BMap.Size(-15, 30) }); marker.setLabel(label); } createInfoText() { const Text = Laya.Text; infoText = new Text(); Laya.stage.addChild(infoText); infoText.fontSize = 50; infoText.color = "#FFFFFF"...

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

6. UI-List [ 86%]

...g(cell.dataSource); } private onSelect(index: number): void { console.log("当前选择的索引:" + index); } } import Box = Laya.Box; import Image = Laya.Image; class Item extends Box { public static WID: number = 373; public static HEI: number = 85; private img: Image; constructor(){ super(); t...

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

7. 鼠标交互-双指缩放(多点触控) [ 82%]

...; } } onMouseMove(e) { let distance = this.getDistance(e.touches); //判断当前距离与上次距离变化,确定是放大还是缩小 const factor = 0.01; this.sp.scaleX += (distance - lastDistance) * factor; this.sp.scaleY += (distance - lastDistance) * factor; lastDistance = distance; } onMou...

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

8. UI-RefreshList [ 74%]

...ull; this.loadingLabel = null; this.refreshList = null; /** 消息生成的当前最大id值 */ this.msgIdNow=1; /** 滚动条效果是否停止 */ this.scrollBarIsStop=false; /** 移动前的上次坐标位置 */ this.moveLastPos = null; /** 列表单元是否已打开 */ this.itemIsOpen=false; /**...

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