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

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

21. 输入设备-指南针 [ 88%]

...); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Laya.loader.load(compassImgPath, Handler.create(this, this.init)); } init() { const Gyroscope = Laya.Gyroscope, Event = Laya.Event; // 创建...

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

22. Sprite-节点控制 [ 88%]

...); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; createApes(); })(); function createApes() { //显示两只猩猩 ape1 = new Sprite(); ape2 = new Sprite(); ape1.loadImage("../../res/apes/monkey2.png")...

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

23. 鼠标交互-双指旋转(多点触控) [ 88%]

...); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; setup(); })(); function setup() { createSprite(); Laya.stage.on(Event.MOUSE_UP, this, onMouseUp); Laya.stage.on(Event.MOUSE_OUT, this, onMouseUp); } fu...

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

24. Sprite-轴心点 [ 88%]

...); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; createApes(); })(); function createApes() { var gap = 300; sp1 = new Sprite(); sp1.loadImage("../../res/apes/monkey2.png", 0, 0); sp1.pos((Laya.stage.w...

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

25. 鼠标交互-双指旋转(多点触控) [ 88%]

...); 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() { this.createSprite(); Laya.stage.on(Event.MOUSE_UP, this, this.onMouseUp); Laya.stage.on(Event.MOUSE_OU...

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

26. Sprite-容器 [ 87%]

...); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.showApe(); } showApe() { const Sprite = Laya.Sprite; const layoutRadius = 150, radianUnit = Math.PI / 2; // 该容器用于装载4张猩...

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

27. 缓动-缓动函数演示 [ 87%]

...); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.setup(); } setup() { this.createCharacter(); this.createEaseFunctionList(); this.createDurationCrontroller(); } createCharacter() { cons...

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

28. 输入设备-摇一摇 [ 87%]

...sole.y; console.color = "#FFFFFF"; console.fontSize = 50; console.align = "center"; console.valign = 'middle'; console.leading = 10; } function startShake() { Shake.instance.start(5, 500); Shake.instance.on(Laya.Event.CHANGE, this, onShake); console.text = '开始接收设备摇动\n'; } function on...

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

29. 缓动-缓动函数演示 [ 87%]

...); 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() { createCharacter(); createEaseFunctionList(); createDurationCrontroller(); } function createCharacter() { ch...

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

30. DOM元素-视频 [ 87%]

...600); Laya.stage.bgColor = "#FFFFFF"; Laya.stage.alignH = Laya.Stage.ALIGN_CENTER; Laya.stage.alignV = Laya.Stage.ALIGN_MIDDLE; // 创建Video元素 var videoElement = Laya.Browser.createElement("video"); Laya.Browser.document.body.appendChild(videoElement); // 设置Video元素地样式和属性 vi...

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