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

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

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

...leMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { const Event = Laya.Event; this.createSprite(); Laya.stage.on(Event.MOUSE_UP, this, this.onMouseUp); Laya.stage.on(Event.MOUSE_OUT, this, this.onMouseUp); } createSprite() { const Sprite = Laya.Sprite...

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

302. 区块地图-PerspectiveWall [ 69%]

...E; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.bgColor = "#232628"; this.createMap(); } private createMap(): void { this.tiledMap = new TiledMap(); this.tiledMap.createMap("../../res/tiledMap/perspective_walls.json", new Rectangle(0, 0, Laya.stage.width, Laya.stage.height), null); } } } new l...

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

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

...leMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.init(); } init() { const Sprite = Laya.Sprite, Animation = Laya.Animation, Text = Laya.Text, Event = Laya.Event; // 创建背景 this.spBg = Sprite.fromImage(PathBg); Laya.stage.addChild(this.spBg); // 创建动画 this....

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

304. 文本-自动调整文本尺寸 [ 69%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.setup(); } setup() { const Text = Laya.Text; // 该文本自动适应尺寸 var autoSizeText = this.createSampleText(); autoSizeText.overflow = Text.VISIBLE; autoSizeText.y = 50; // 该文本被限制了宽度 var widthL...

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

305. 计时器-延迟执行 [ 69%]

....height - vGap) / 2; Laya.stage.addChild(button1); button1.on(Event.CLICK, this, onDecreaseAlpha1); button2 = createButton("点我60帧之后 alpha - 0.5"); button2.pos(button1.x, button1.y + vGap); Laya.stage.addChild(button2); button2.on(Event.CLICK, this, onDecreaseAlpha2); } function createButto...

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

306. UI-Clip [ 69%]

...Laya.loader.load([buttonSkin, clipSkin, bgSkin], laya.utils.Handler.create(this, onSkinLoaded)); })(); function onSkinLoaded() { showBg(); createTimerAnimation(); showTotalSeconds(); createController(); } function showBg() { var bg = new Image(bgSkin); bg.size(224, 302); bg.pos(Laya.stage.width - bg...

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

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

...(); })(); function setup() { createSprite(); Laya.stage.on(Event.MOUSE_UP, this, onMouseUp); Laya.stage.on(Event.MOUSE_OUT, this, onMouseUp); } function createSprite() { sp = new Sprite(); var w = 300, h = 300; sp.graphics.drawRect(0, 0, w, h, "#FF7F50"); sp.size(w, h); sp.pivot(w / 2, h / 2); sp.po...

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

308. 照相机-3D空间转2D空间 [ 69%]

...../res/threeDimen/skinModel/LayaMonkey/LayaMonkey.lh", Laya.Handler.create(this, onComplete)); function onComplete() { layaMonkey3D = scene.addChild(Laya.Sprite3D.load("../../res/threeDimen/skinModel/LayaMonkey/LayaMonkey.lh")); layaMonkey2D = Laya.stage.addChild(new Laya.Image("../../res/threeDimen...

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

309. 计时器-延迟调用 [ 69%]

...nction demonstrate() { for (var i = 0; i < 10; i++) { Laya.timer.callLater(this, onCallLater); } } function onCallLater() { console.log("onCallLater triggered"); var text = new Text(); text.font = "SimHei"; text.fontSize = 30; text.color = "#FFFFFF"; text.text = "打开控制台可见该函数仅触...

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

310. [LayaAir3]Laya.LayaGL 是null [ 68%]

...关问题 alertexception info: [Typeerror: null is not object (evaluating this. vaoext createvertexarrayoes"] Cannot read property 'displayObject' of null laya2.6.0打apk和小游戏都会报_InPool为null Uncaught TypeError: Cannot read property 'load' of null 打包apk之后,突然报一个错...

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