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

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

1. Sprite-屏幕截图 [ 100%]

...(Laya.Event.CLICK,this,cb); btn.size(147,55); btn.name = name; btn.right = 10; btn.top = index * (btn.height + 10); return btn; } onLoaded(){ for (let index = 0; index = ["res/button.png", "res/button.png", "res/button.png"]; private nameArr:Array = ["canvas截图","sprite截图","清理"]; private ...

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

2. 鼠标交互-修正交互区域 [ 99%]

...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_示例 发布时间: 20241117

3. 滤镜-发光滤镜 [ 92%]

...t GlowFilter = Laya.GlowFilter; let glowFilter = new GlowFilter("#ffff00", 10, 0, 0); // 设置滤镜集合为发光滤镜 this.ape.filters = [glowFilter]; } } new Filters_Glow();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import GlowFilter = Laya.GlowFilter; import Texture...

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

4. 音频-播放演示 [ 86%]

...Stat.show(); this.setup(); } setup() { const Event = Laya.Event; var gap = 10; //创建一个Sprite充当音效播放按钮 let soundButton = this.createButton("播放音效"); soundButton.x = (Laya.stage.width - soundButton.width * 2 + gap) / 2; soundButton.y = (Laya.stage.height - soundButton.heig...

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

5. DOM元素-表单输入 [ 85%]

...2); Laya.stage.addChild(this.form); this.rowHeight = 30; this.rowSpacing = 10; let rowHeightDelta = this.rowSpacing + this.rowHeight; // 显示左侧标签 this.showLabel("邮箱", 0, rowHeightDelta * 0); this.showLabel("出生日期", 0, rowHeightDelta * 1); this.showLabel("密码", 0, rowHeightDel...

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

6. UI-List [ 79%]

...路径 let data = []; for (let i = 0; i = []; for (var i: number = 0; i < 10; ++i) { data.push("res/ui/listskins/1.jpg"); data.push("res/ui/listskins/2.jpg"); data.push("res/ui/listskins/3.jpg"); data.push("res/ui/listskins/4.jpg"); data.push("res/ui/listskins/5.jpg"); } list.array = data; } private...

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

7. UI-RefreshList [ 77%]

...= new Box(); this.refreshLoading.pos(133, 0); this.refreshLoading.bottom = 10; this.refreshLoading.visible = false; this.baseBox.addChild(this.refreshLoading); // 加载动画 this.loadingAni = new Animation(); this.loadingAni.loadAnimation("res/ui/refreshList/ani/Refresh.ani"); this.loadingAni.pos(...

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

8. 鼠标交互-鼠标交互 [ 73%]

...发相应事件\n"; txt.size(Laya.stage.width, Laya.stage.height); txt.pos(10, 50); txt.fontSize = 20; txt.wordWrap = true; txt.color = "#FFFFFF"; Laya.stage.addChild(txt); } } new Interaction_Mouse();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Text = Laya.Text; impo...

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

9. 2D物理-仿生机器人 [ 71%]

...nd.addComponent(Laya.ChainCollider); chainCollider.points = "50,200,50,570,1050,570,1050,200"; for (let i = 1; i 0) { legCollider1.points = p1.concat(p2).concat(p3).join(","); legCollider2.points = [0, 0].concat(B2Math.SubVV(p5, p4)).concat(B2Math.SubVV(p6, p4)).join(","); } else { legCollider1.poin...

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

10. 2D物理-碰撞过滤器 [ 44%]

... 20, i); this.createTriangle(500, 300, 20, i); this.createCircle(700, 300, 10, i); } } private function createHouse() { var house= new Sprite(); Laya.stage.addChild(house); var rigidbody: RigidBody = house.addComponent(RigidBody); rigidbody.type = "static"; var chainCollider: ChainCollider = house.a...

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