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

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

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

...thing() { let sp = new Laya.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...

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

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

...C779A"], colorCount = 0, isDown = false, path = [], color = colors[0], liveGraphics, canvasGraphics; class PIXI_Example_21 { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler, Loader = Laya.Loader; // 不支持WebGL时自...

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

3. Sprite-屏幕截图 [ 94%]

...dth/2,Browser.clientHeight/2); Laya.stage.addChild(this.aimSp); this.aimSp.graphics.drawRect(0,0,this.aimSp.width,this.aimSp.height,"#333333"); this.monkeyTexture = Laya.loader.getRes("res/apes/monkey3.png"); this.aimSp.graphics.drawTexture(this.monkeyTexture,0,0,this.monkeyTexture.width,this.monkey...

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

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

...ld(directionIndicator); directionIndicator.alpha = 0.8; directionIndicator.graphics.drawCircle(0, 0, 70, "#343434"); directionIndicator.graphics.drawLine(-40, 0, 40, 0, "#FFFFFF", 3); directionIndicator.graphics.drawLine(0, -40, 0, 40, "#FFFFFF", 3); directionIndicator.x = compassImg.x; directionInd...

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

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

... 14.37 var color = "#FF7F50"; this.sprite = new Laya.Sprite(); this.sprite.graphics.drawLine(0, 0, -radiusX, radiusY, color); this.sprite.graphics.drawLine(0, 0, radiusX, radiusY, color); this.sprite.graphics.drawLine(-radiusX, radiusY, 0, radiusY * 2, color); this.sprite.graphics.drawLine(radiusX, ...

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

6. Sprite-新手引导 [ 90%]

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

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

7. 鼠标交互-修正交互区域 [ 86%]

...= Laya.Sprite, Event = Laya.Event; let 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...

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

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

... let monkey = (this.flag = !this.flag) ? monkey1Res : monkey2Res; this.ape.graphics.clear(); this.ape.graphics.drawTexture(monkey, 0, 0); this.ape.size(monkey.width, monkey.height); } } new Sprite_SwitchTexture();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Texture = ...

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

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

...ite; let btn = new Sprite(); Laya.stage.addChild(btn); btn.size(w, h); btn.graphics.drawRect(0, 0, w, h, "#FF7F50"); btn.graphics.fillText(labelText, w / 2, 8, "24px SimHei", "#FFFFFF", "center"); return btn; } // 播放音效 onPlaySound() { console.log("播放音效"); Laya.SoundManager.playSound(...

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

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

...alRect() { const Sprite = Laya.Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } updateRectPos() { this.rect.x = Laya.stage.width / 2; this.rect.y = Laya.stage.height / 2; } } new SmartScale_Scale_NOBO...

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