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

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

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

...0], "#ff0000", 5); //画曲线 sp.graphics.drawCurves(352, 58, [0, 0, 19, -100, 39, 0, 58, 100, 78, 0, 97, -100, 117, 0, 136, 100, 156, 0], "#ff0000", 5); //画矩形 sp.graphics.drawRect(10, 166, 166, 90, "#ffff00"); //画多边形 sp.graphics.drawPoly(264, 166, [0, 0, 60, 0, 78.48, 57, 30, 93.48, ...

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

2. 缓动-时间线 [ 96%]

...dImage("res/apes/monkey2.png"); this.target.pivot(55, 72); this.target.pos(100,100); } createTimerLine() { const TimeLine = Laya.TimeLine, Event = Laya.Event; this.timeLine = new TimeLine(); // addLabel(label:String, offset:Number) offset: 标签事件相对于上个动画的偏移时间(单位:...

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

3. 鼠标交互-修正交互区域 [ 95%]

...et deepSkyblueRect = new Sprite(); deepSkyblueRect.graphics.drawRect(0, 0, 100, 100, "#00BFFF"); //设置名称 deepSkyblueRect.name = "天蓝色矩形"; //设置宽高(要接收鼠标事件必须设置宽高,否则不会被命中) deepSkyblueRect.size(100, 100); deepSkyblueRect.pos(10, 10); L...

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

4. 屏幕适配-对齐模式 [ 93%]

...andler = Laya.Handler; // 不支持WebGL时自动切换至Canvas Laya.init(100, 100, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_NOSCALE; Laya.stage.bgColor = "#232628"; } } new SmartScale_Align_Contral();module laya { im...

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

5. 屏幕适配-缩放-No Border [ 91%]

...rite = 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_NOBORDER();module laya ...

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

6. 屏幕适配-缩放-No Scale [ 91%]

...rite = 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_NOSCALE();module laya {...

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

7. 屏幕适配-缩放-Extract Fit [ 90%]

...rite = 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_EXTRACT_FIT();module la...

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

8. 屏幕适配-缩放-Show All [ 90%]

...rite = 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_SHOW_ALL();module laya ...

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

9. 加载-多种类型资源加载 [ 90%]

...T_TEXTURE_PATH = "res/skeleton/robot/texture.png"; (function() { Laya.init(100, 100); var assets = []; assets.push( { url: ROBOT_DATA_PATH, type: Loader.BUFFER }); assets.push( { url: ROBOT_TEXTURE_PATH, type: Loader.IMAGE }); Laya.loader.load(assets, Handler.create(this, onAssetsLoaded)); })(); fun...

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

10. 2D物理-碰撞事件与传感器 [ 90%]

...a.CircleCollider); sensorCollider.isSensor = true; sensorCollider.radius = 100; sensorCollider.x = 450; sensorCollider.y = 300; for (let i = 0, len = this.count; i = []; private touching: Array = []; constructor(maincls: typeof Main) { this.Main = maincls; Laya.Config.isAntialias = true; Laya.init(1...

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