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

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

1. 2D物理-复合碰撞器 [ 100%]

...ya.Browser.width / 2, posy = Laya.Browser.height / 2; let box = this.box = new Laya.Sprite(); box.size(width + height * 2, width + height * 2); box.pivot(box.width / 2, box.height / 2); box.pos(posx, posy); Laya.Laya.stage.addChild(box); let boxBody = box.addComponent(Laya.RigidBody); let box1Shape ...

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

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

....bgColor = "#232628"; this.createSensor(); } createSensor() { let ground = new Laya.Sprite(); Laya.Laya.stage.addChild(ground); let groundBody = new Laya.RigidBody(); groundBody.type = "static"; ground.addComponentIntance(groundBody); let chainCollider = ground.addComponent(Laya.ChainCollider); chai...

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

3. UI-List [ 91%]

...ctor(){ super(); const Image = Laya.Image; this.size(WID, HEI); this.img = new Image(); this.addChild(this.img); } setImg(src) { this.img.skin = src; } } class UI_List { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler; //...

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

4. UI-Tree [ 87%]

...析tree的数据 let xml = Utils.parseXMLFromString(treeData); let tree = new Tree(); tree.scrollBarSkin = "res/ui/vscroll.png"; tree.itemRender = Item; tree.xml = xml; tree.size(300, 300); tree.x = (Laya.stage.width - tree.width) / 2; tree.y = (Laya.stage.height - tree.height) / 2; Laya.stage.addCh...

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

5. IDE-显示IDE创建的界面 [ 82%]

...染方式,可以打开下面注释看一下效果 //list.renderHandler = new Handler(this, onListRender); } private onListRender(item: Laya.Box, index: number): void { //自定义list的渲染方式 var label: Label = item.getChildByName("label") as Label; if (index % 2) { label.color = "#ff0000";...

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

6. 2D物理-仿生机器人 [ 76%]

...628"; this.Construct(); this.eventListener(); } Construct() { let ground = new Laya.Sprite(); Laya.Laya.stage.addChild(ground); let rigidbody = new Laya.RigidBody(); rigidbody.type = "static"; ground.addComponentIntance(rigidbody); let chainCollider = ground.addComponent(Laya.ChainCollider); chainCo...

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

7. 2D物理-碰撞过滤器 [ 75%]

...storyJoint); Laya.stage.off(Event.MOUSE_OUT, this, this.destoryJoint); } } new Physics_Physics_CollisionFiltering();package { import laya.display.Sprite; import laya.display.Stage; import laya.events.Event; import laya.physics.BoxCollider; import laya.physics.ChainCollider; import laya.physics.Circl...

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

8. 缓动-缓动函数演示 [ 75%]

...ontroller(); } 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.Handler; let easeFunctionsList = ne...

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

9. UI-RefreshList [ 73%]

...nitView(){ // 加载并添加场景中需要使用的资源 this.baseBox = new Box(); this.baseBox.width = 443; this.baseBox.height = 622; this.baseBox.pos(30, 28); this.baseBox.bgColor = "#ffffff"; // 加载进度条 this.refreshLoading = new Box(); this.refreshLoading.pos(133, 0); this.refreshLoad...

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

10. 2D物理-桥 [ 72%]

...); } createBridge() { const startPosX = 250, startPosY = 450; let ground = new Laya.Sprite(); Laya.Laya.stage.addChild(ground); let groundBody = new Laya.RigidBody(); groundBody.type = "static"; ground.addComponentIntance(groundBody); let chainCollider = ground.addComponent(Laya.ChainCollider); chai...

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