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

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

1. UI-List [ 100%]

...ild(this.img); this.setImg = function(src) { this.img.skin = src; } } Laya.class(Item, "Item", Box); // 主要逻辑代码 var Stage = Laya.Stage; var List = Laya.List; var Handler = Laya.Handler; var WebGL = Laya.WebGL; (function() { // 不支持WebGL时自动切换至Canvas Laya.init(800, 600, Web...

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

2. 调试-帧率统计 [ 97%]

...dule laya { import Browser = Laya.Browser; import Stat = Laya.Stat; export class Debug_FPSStats { constructor() { Laya.init(Browser.clientWidth, Browser.clientHeight); Stat.show(Browser.clientWidth - 120 >> 1, Browser.clientHeight - 100 >> 1); } } } new laya.Debug_FPSStats();package { import laya.ut...

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

3. 屏幕适配-对齐模式 [ 97%]

...or = "#232628"; })(); })();module laya { import Stage = Laya.Stage; export class SmartScale_Align_Contral { constructor() { Laya.init(100, 100); Laya.stage.scaleMode = Stage.SCALE_NOSCALE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.bgColor = "#232628";...

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

4. 性能测试-虫子(慎入) [ 94%]

...Stat; import Rectangle = Laya.Rectangle; import WebGL = Laya.WebGL; export class PerformanceTest_Maggots { private texturePath:string = "../../res/tinyMaggot.png"; private padding:number = 100; private maggotAmount:number = 5000; private tick:number = 0; private maggots:Array = []; private wrapBound...

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

5. 输入设备-贪吃蛇(重力感应) [ 93%]

... return new Point(tx, ty); } this.size(width, height); this.init(); } Laya.class(Segment, "Segment", Sprite); var seg; var segments = []; var foods = []; var initialSegmentsAmount = 5; var vx = 0, vy = 0; var targetPosition; (function() { Laya.init(Browser.width, Browser.height, WebGL); // 初始化...

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

6. 屏幕适配-缩放-No Scale [ 92%]

...dule laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; export class SmartScale_Scale_NOSCALE { private rect: Sprite; constructor() { Laya.init(550, 400); Laya.stage.scaleMode = Stage.SCALE_NOSCALE; Laya.stage.bgColor = "#232628"; this.createCantralRect(); } private createCantralRect(): ...

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

7. 屏幕适配-缩放-No Border [ 92%]

...dule laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; export class SmartScale_Scale_NOBORDER { private rect: Sprite; constructor() { Laya.init(550, 400); Laya.stage.scaleMode = Stage.SCALE_NOBORDER; Laya.stage.bgColor = "#232628"; this.createCantralRect(); } private createCantralRect()...

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

8. 高级应用-基于物理渲染 [ 92%]

... scene.getChildByName("Camera"); camera.addComponent(CameraMoveScript); });class PBRDemo { constructor() { Laya3D.init(0, 0, true); Laya.stage.scaleMode = Laya.Stage.SCALE_FULL; Laya.stage.screenMode = Laya.Stage.SCREEN_NONE; Laya.Stat.show(); var scene: Laya.Scene = Laya.stage.addChild(Laya.Scene.l...

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

9. 屏幕适配-缩放-Show All [ 92%]

...dule laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; export class SmartScale_Scale_SHOW_ALL { private rect: Sprite; constructor() { Laya.init(550, 400); Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.createCantralRect(); } private createCantralRect():...

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

10. 屏幕适配-缩放-Extract Fit [ 92%]

...dule laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; export class SmartScale_Scale_EXTRACT_FIT { private rect: Sprite; constructor() { Laya.init(550, 400); Laya.stage.scaleMode = Stage.SCALE_EXACTFIT; Laya.stage.bgColor = "#232628"; this.createCantralRect(); } private createCantralRec...

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