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

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

1. 其他引擎的Demo-Example_21 [ 100%]

...Laya.stage.on('mouseup', this, this.onMouseUp); } createCanvases() { const Sprite = Laya.Sprite; let graphicsCanvas = new Sprite(); Laya.stage.addChild(graphicsCanvas); let liveGraphicsCanvas = new Sprite(); Laya.stage.addChild(liveGraphicsCanvas); liveGraphics = liveGraphicsCanvas.graphics; canvasG...

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

2. 区块地图-等角地图 [ 98%]

...ayer.getScreenPositionByTilePos(Math.floor(p.x), Math.floor(p.y), p); this.sprite.pos(p.x, p.y); } mapLoaded() { this.layer = this.tiledMap.getLayerByIndex(0); var radiusX = 32; var radiusY = Math.tan(180 / Math.PI * 30) * radiusX; // 14.37 var color = "#FF7F50"; this.sprite = new Laya.Sprite(); thi...

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

3. 滤镜-颜色滤镜 [ 86%]

...ild.x + apeTexture.width; grayApe.y = secondChild.y; } createApe() { const Sprite = Laya.Sprite; let ape = new Sprite(); Laya.stage.addChild(ape); apeTexture = Laya.loader.getRes(apePath); ape.graphics.drawTexture(apeTexture); return ape; } } new Filters_Color();module laya { import Sprite = Laya.Sp...

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

4. 缓动-缓动函数演示 [ 85%]

...ctionList(); this.createDurationCrontroller(); } createCharacter() { const Sprite = Laya.Sprite; character = new Sprite(); Laya.stage.addChild(character); character.loadImage("res/cartoonCharacters/1.png"); character.pos(100, 50); } createEaseFunctionList() { const List = Laya.List, Handler = Laya.H...

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

5. Sprite-缓存为静态图像 [ 83%]

...peScript三种开发语言、LayaAirIDE让项目开发更高效。class Sprite_Cache { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = S...

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

6. 混合模式-Lighter [ 80%]

... = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Sprite = Laya.Sprite, Tween = Laya.Tween; // 不支持WebGL时自动切换至Canvas Laya.init(phoenixWidth * 2, phoenixHeight, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage...

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

7. 输入设备-摇一摇 [ 78%]

...Pic(); this.showConsoleText(); this.startShake(); } showShakePic() { const Sprite = Laya.Sprite; let shakePic = new Sprite(); shakePic.loadImage("res/inputDevice/shake.png"); Laya.stage.addChild(shakePic); } showConsoleText() { const Text = Laya.Text; console = new Text(); Laya.stage.addChild(consol...

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

8. 性能测试-卡通人物2 [ 76%]

...= 0) { text.text = Stat.FPS.toString(); } } } class Character extends Laya.Sprite { constructor(images) { super(); this.speed = 5; this.bloodBar; this.animation; this.nameLabel; this.createAnimation(images); this.createBloodBar(); this.createNameLabel(); } createAnimation(images) { const Animation =...

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

9. 鼠标交互-修正交互区域 [ 74%]

...stage.on(Event.MOUSE_DOWN, this, this.onDown); } createCoralRect() { const Sprite = 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(...

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

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

...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.aniFly = new Animation(); this...

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