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

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

1. UI-Label [ 100%]

...32628"; setup(); })(); function setup() { createLabel("#FFFFFF", null).pos(30, 50); createLabel("#00FFFF", null).pos(290, 50); createLabel("#FFFF00", "#FFFFFF").pos(30, 100); createLabel("#000000", "#FFFFFF").pos(290, 100); createLabel("#FFFFFF", "#00FFFF").pos(30, 150); createLabel("#0080FF", "#00F...

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

2. Sprite-根据数据绘制路径 [ 92%]

...= new Sprite(); Laya.stage.addChild(canvas); var path = []; path.push(0, -130); path.push(33, -33); path.push(137, -30); path.push(55, 32); path.push(85, 130); path.push(0, 73); path.push(-85, 130); path.push(-55, 32); path.push(-137, -30); path.push(-33, -33); canvas.graphics.drawPoly(Laya.stage.wi...

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

3. 天空-天空穹 [ 80%]

...new Laya.Vector3(0, 0.8, 1.5)); camera.transform.rotate(new Laya.Vector3( -30, 0, 0), true, false); camera.addComponent(CameraMoveScript); camera.clearFlag = Laya.BaseCamera.CLEARFLAG_SKY; var skyDome = new Laya.SkyDome(); camera.sky = skyDome; skyDome.texture = Laya.Texture2D.load("../../res/threeD...

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

4. 天空-天空盒 [ 79%]

...new Laya.Vector3(0, 0.8, 1.5)); camera.transform.rotate(new Laya.Vector3( -30, 0, 0), true, false); camera.addComponent(CameraMoveScript); camera.clearFlag = Laya.BaseCamera.CLEARFLAG_SKY; //天空盒 var skyBox = new Laya.SkyBox(); camera.sky = skyBox; skyBox.textureCube = Laya.TextureCube.load(".....

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

5. 文本-HTML文本 [ 79%]

...ent(); Laya.stage.addChild(p); p.style.font = "Impact"; p.style.fontSize = 30; var html = "使用"; html += "HTMLDivElement"; html += "创建的"; html += "HTML文本"; p.innerHTML = html; } function showExternalHTML() { var p = new HTMLIframeElement(); Laya.stage.addChild(p); p.href = "../../res/ht...

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

6. 射线检测-射线检测 [ 79%]

...器 if (_scale >= 1) _scaleIndex = -1; else if (_scale ,最大检测距离30米,只检测第10层 Laya.Physics.rayCastAll(ray, _outHitAllInfo, 30, 10); for (var i = 0; i ,最大检测距离30米,只检测第13层 Laya.Physics.rayCast(ray, _outHitInfo, 30, 13); if (_outHitInfo.distance !== -1) { str ...

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

7. 计时器-延迟调用 [ 79%]

... triggered"); var text = new Text(); text.font = "SimHei"; text.fontSize = 30; text.color = "#FFFFFF"; text.text = "打开控制台可见该函数仅触发了一次"; text.size(Laya.stage.width, Laya.stage.height); text.wordWrap = true; text.valign = "middle"; text.align = "center"; Laya.stage.addCh...

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

8. 动画-图集动画 [ 78%]

...mation(); ani.loadAtlas(AniConfPath); // 加载图集动画 ani.interval = 30; // 设置播放间隔(单位:毫秒) ani.index = 1; // 当前播放索引 ani.play(); // 播放图集动画 // 获取动画的边界信息 var bounds = ani.getGraphicBounds(); ani.pivot(bounds.width / 2, bounds.heig...

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

9. UI-ComboBox [ 77%]

...omboBox(skin, "item0,item1,item2,item3,item4,item5"); comboBox.labelSize = 30; comboBox.itemSize = 25; comboBox.selectHandler = new Handler(this, onSelect, [comboBox]); Laya.stage.addChild(comboBox); return comboBox; } function onSelect(cb) { console.log("选中了: " + cb.selectedLabel); } })();m...

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

10. 计时器-间隔循环 [ 76%]

...n createText(text, x, y) { var t = new Text(); t.text = text; t.fontSize = 30; t.color = "white"; t.bold = true; t.pivot(t.width / 2, t.height / 2); t.pos(x, y); Laya.stage.addChild(t); return t; } function animateTimeBased() { rotateTimeBasedText.rotation += 1; } function animateFrameRateBased() { ...

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