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

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

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

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

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

2. 屏幕适配-屏幕适配 [ 93%]

..."exactfit", "showall", "noborder", "full", "fixedwidth", "fixedheight"]; //当前适配模式索引 var index = 0; //全局文本信息 var txt; (function() { // 不支持WebGL时自动切换至Canvas Laya.init(1136, 640); //设置适配模式 Laya.stage.scaleMode = "noscale"; //设置横竖屏 Laya...

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

3. UI-Tab [ 93%]

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

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

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

...t.fontSize = 100; degreesText.color = "#FFFFFF"; } // 方位指示器指向当前所朝方位。 function createDirectionIndicator() { directionIndicator = new Sprite(); Laya.stage.addChild(directionIndicator); directionIndicator.alpha = 0.8; directionIndicator.graphics.drawCircle(0, 0, 70, "#343434...

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

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

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

来源: Laya_示例 发布时间: 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...

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

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

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

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