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

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

1. 输入设备-指南针 [ 100%]

...reateDirectionIndicator(); // // 画出其他UI this.drawUI(); // // 创建显示角度的文本 this.createDegreesText(); Gyroscope.instance.on(Event.CHANGE, this, this.onOrientationChange); } // 方位指示器指向当前所朝方位 createCompass() { const Sprite = Laya.Sprite; compassImg = new ...

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

2. Sprite-显示图片 [ 89%]

...wser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage; // 2D场景显示时打开 Laya.Config.isAntialias = true; // 2D场景显示错乱时打开 Laya.Config.useWebGL2 = false; // 支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage...

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

3. DOM元素-表单输入 [ 82%]

...rowSpacing = 10; let rowHeightDelta = this.rowSpacing + this.rowHeight; // 显示左侧标签 this.showLabel("邮箱", 0, rowHeightDelta * 0); this.showLabel("出生日期", 0, rowHeightDelta * 1); this.showLabel("密码", 0, rowHeightDelta * 2); // 显示右侧输入框 let emailInput = this.create...

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

4. Sprite-节点控制 [ 80%]

...e.bgColor = "#232628"; this.createApes(); } private createApes(): void { //显示两只猩猩 this.ape1 = new Sprite(); this.ape2 = new Sprite(); this.ape1.loadImage("res/apes/monkey2.png"); this.ape2.loadImage("res/apes/monkey2.png"); this.ape1.pivot(55, 72); this.ape2.pivot(55, 72); this.ape1.pos(...

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

5. Sprite-切换纹理 [ 79%]

...vot(55, 72); this.ape.pos(Laya.stage.width / 2, Laya.stage.height / 2); // 显示默认纹理 this.switchTexture(); this.ape.on("click", this, this.switchTexture); } private switchTexture(): void { var textureUrl: string = (this.flag = !this.flag) ? this.texture1 : this.texture2; // 更换纹理 thi...

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

6. 鼠标交互-修正交互区域 [ 72%]

...addChild(darkOrchidRect); // 为true时,碰撞区域会被修正为实际显示边界 // mouseThrough命名真是具有强烈的误导性 darkOrchidRect.mouseThrough = true; darkOrchidRect.on(Event.MOUSE_DOWN, this, this.onDown); } createLogger() { const Text = Laya.Text; logger = new Text(); logg...

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

7. 加载-销毁Texture使用的图片资源 [ 47%]

...tage.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; this.init(); //显示性能统计信息 Stat.show(); } /** * 初始化场景 */ private init():void { //创建背景 this.spBg = Sprite.fromImage(this.PathBg); Laya.stage.addChild(this.spBg); //创建动画 this.aniFly = new Animation(); th...

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

8. UI-RefreshList [ 42%]

...ntName, this, () => { console.log("达到了滚动限制:" + eventName); //显示加载进度ui this.refreshLoading.visible = true; //处理加载ui的位置 if (eventName === "dragTopLimit") { //先清理bottom的状态,避免top计算出错 this.refreshLoading.bottom = NaN; this.refreshLoading.t...

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