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

大约有 257 项符合查询结果, 库内数据总量为 31,722 项。 (搜索耗时: 0.0052 秒)

21. setSubPixels画布擦除不掉 [ 90%]

...0; this._testStatus = !this._testStatus; // let canvasInfo = this.getCanvasWidthHeight(); let ctx = new Laya.Context(); // let w = canvasInfo.w//tex.width; // let h = canvasInfo.h//tex.height; let w = tex.width; let h = tex.height; ctx.size(w,h); ctx.asBitmap = true; // ctx.clearRect(0,0,w,h); let _...

来源: Laya_社区 发布时间: 20230328

22. 输入设备-地图 [ 90%]

...vertor(); // Div var mapDiv; var infoText; (function() { Laya.init(Browser.width, 255); Laya.stage.scaleMode = Stage.SCALE_NOSCALE; createDom(); initMap(); createInfoText(); var successHandler = new Handler(this, updatePosition); var errorHandler = new Handler(this, onError); // 使用高精度位...

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

23. 计时器-延迟执行 [ 90%]

... Laya.Handler; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.width, Browser.height, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() {...

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

24. Sprite中的width,height和size(width,height)感觉没作用啊 [ 90%]

Sprite中的width,height和size(width,height)感觉没作用啊 我的图片是800*600,懒得修改图片,想在程序中直接修改图片显示大小,可是貌似显示的还是800*600。width,height,size(width,height)是我理解问题,还是我写错了呢。。。。 ...

来源: Laya_社区 发布时间: 20160711

25. 2D光遮挡器与阴影 · LayaAir3.4 · 引擎文档 · LAYABOX [ 90%]

...tReceive = true; } // 生成一个矩形 private generateRectVerticesAndUV(width: number, height: number): Laya.Mesh2D { const vertices = new Float32Array(4 * 5); const indices = new Uint16Array(2 * 3); let index = 0; vertices[index++] = 0; vertices[index++] = 0; vertices[index++] = 0; vertices[inde...

来源: Laya3.0_文档 发布时间: 20251010

26. 输入设备-地图 [ 90%]

...a.Geolocation; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.width, 255); // Laya.stage.alignV = Stage.ALIGN_MIDDLE; // Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_NOSCALE; Laya.stage.bgColor = "#232628"; // 本地运行,需要在index.html中引用百...

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

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

...assImg); compassImg.loadImage(compassImgPath); compassImg.pivot(compassImg.width / 2, compassImg.height / 2); compassImg.pos(Laya.stage.width / 2, 400); } function drawUI() { var canvas = new Sprite(); Laya.stage.addChild(canvas); canvas.graphics.drawLine(compassImg.x, 50, compassImg.x, 182, "#FFFFF...

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

28. 计时器-延迟执行 [ 89%]

...tion() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; setup(); })(); function setup() ...

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

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

...assImg); compassImg.loadImage(compassImgPath); compassImg.pivot(compassImg.width / 2, compassImg.height / 2); compassImg.pos(Laya.stage.width / 2, 400); } createDirectionIndicator() { const Sprite = Laya.Sprite; directionIndicator = new Sprite(); Laya.stage.addChild(directionIndicator); directionInd...

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

30. 显示文本组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 89%]

...,此方法只执行一次 */ onAwake(): void { this.lab.pos(Laya.stage.width >> 1, Laya.stage.height >> 1); //位置 this.lab.size(500, 30); //大小 this.lab.pivot(this.lab.width/2, this.lab.height/2); //轴心点 this.lab.text = "大家好,欢迎大家来到LayaAir IDE"; //文本...

来源: Laya3.0_文档 发布时间: 20251010