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

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

1. Sprite-绘制各种形状 [ 100%]

... drawSomething() { sp = new Sprite(); Laya.stage.addChild(sp); //画线 sp.graphics.drawLine(10, 58, 146, 58, "#ff0000", 3); //画连续直线 sp.graphics.drawLines(176, 58, [0, 0, 39, -50, 78, 0, 117, 50, 156, 0], "#ff0000", 5); //画曲线 sp.graphics.drawCurves(352, 58, [0, 0, 19, -100, 39, 0, 58...

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

2. 其他引擎的Demo-Example_21 [ 95%]

...种开发语言、LayaAirIDE让项目开发更高效。(function() { var Graphics = Laya.Graphics; var Sprite = Laya.Sprite; var Browser = Laya.Browser; var WebGL = Laya.WebGL; var colors = ["#5D0776", "#EC8A49", "#AF3666", "#F6C84C", "#4C779A"]; var colorCount = 0; var isDown = false; var path = []...

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

3. 输入设备-指南针 [ 93%]

... drawUI() { var canvas = new Sprite(); Laya.stage.addChild(canvas); canvas.graphics.drawLine(compassImg.x, 50, compassImg.x, 182, "#FFFFFF", 3); canvas.graphics.drawLine(-140 + compassImg.x, compassImg.y, 140 + compassImg.x, compassImg.y, "#AAAAAA", 1); canvas.graphics.drawLine(compassImg.x, -140 + ...

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

4. 区块地图-等角地图 [ 92%]

...h.PI * 30) * radiusX; var color = "#FF7F50"; sprite = new Sprite(); sprite.graphics.drawLine(0, 0, -radiusX, radiusY, color); sprite.graphics.drawLine(0, 0, radiusX, radiusY, color); sprite.graphics.drawLine(-radiusX, radiusY, 0, radiusY * 2, color); sprite.graphics.drawLine(radiusX, radiusY, 0, rad...

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

5. Sprite-新手引导 [ 91%]

...游戏背景 var maskArea = new Sprite(); maskArea.alpha = 0.5; maskArea.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000"); guideContainer.addChild(maskArea); //绘制一个圆形区域,利用叠加模式,从遮罩区域抠出可交互区 interactionArea = new Sprite(); //...

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

6. 鼠标交互-修正交互区域 [ 87%]

...n); } function createCoralRect() { var coralRect = new Sprite(); coralRect.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height / 2, "#FF7F50"); //设置名称 coralRect.name = "珊瑚色容器"; coralRect.size(Laya.stage.width, Laya.stage.height / 2); Laya.stage.addChild(coralRect); coralRec...

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

7. Sprite-切换纹理 [ 85%]

...var textureUrl = (flag = !flag) ? texture1 : texture2; // 更换纹理 ape.graphics.clear(); var texture = Laya.loader.getRes(textureUrl); ape.graphics.drawTexture(texture, 0, 0); // 设置交互区域 ape.size(texture.width, texture.height); } })();module laya { import Sprite = Laya.Sprite; import ...

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

8. 音频-播放演示 [ 82%]

... w = 110; var h = 40; var button = new Sprite(); button.size(w, h); button.graphics.drawRect(0, 0, w, h, "#FF7F50"); button.graphics.fillText(label, w / 2, 8, "25px SimHei", "#FFFFFF", "center"); Laya.stage.addChild(button); return button; } function onPlayMusic(e) { console.log("播放音乐"); Sou...

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

9. 骨骼动画-Spine事件 [ 81%]

...lSprite); mLabelSprite.x = mStartX; mLabelSprite.y = mStartY; mLabelSprite.graphics.clear(); mLabelSprite.graphics.fillText(tEventData.name, 0, 0, "20px Arial", "#ff0000", "center"); Tween.to(mLabelSprite, { y:mStartY - 200 }, 1000, null,Handler.create(this,playEnd)) } function playEnd() { mLabelSpr...

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

10. 屏幕适配-缩放-No Scale [ 80%]

...tralRect(); })(); function createCantralRect() { rect = new Sprite(); rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(rect); updateRectPos(); } function updateRectPos() { rect.x = Laya.stage.width / 2; rect.y = Laya.stage.height / 2; } })();module laya { import Sprite = Lay...

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