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

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

1. UI-RefreshList [ 100%]

...动事件的处理 * @paramthis.item = null; 单元格对象 * @paramthis.index = null; 单元格索引 */ /** * 处理列表刷新数据时的限制 * @paramthis.eventName = null; 要侦听的事件名 * @paramthis.moveLimit = null; 移动距离的上限,达到上限后才会抛出要侦听的事...

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

2. Sprite-屏幕截图 [ 98%]

...),Laya.Handler.create(this,this.onLoaded)); } createButton(skin, name, cb, index) { var btn = new Laya.Button(skin,name); Laya.stage.addChild(btn); btn.on(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 ...

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

3. 屏幕适配-屏幕适配 [ 97%]

..., "exactfit", "showall", "noborder", "full", "fixedwidth", "fixedheight"], index = 0, txt; class SmartScale_T { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler, Image = Laya.Image, Text = Laya.Text; // 不支持WebGL时...

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

4. 骨骼动画-适配版Spine [ 97%]

...Binary { constructor() { this.aniPath = "res/bone/spineboy-pma.skel"; this.index = -1; Laya.init(Browser.width, Browser.height, WebGL); Laya.stage.scaleMode = Stage.SCALE_NOSCALE; Laya.stage.bgColor = "#232628"; Stat.show(); this.startFun(); } startFun() { this.templet = new SpineTemplet(Laya.SpineV...

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

5. UI-Clip [ 88%]

...nds() { const Clip = Laya.Clip; let clip = new Clip(clipSkin, 10, 1); clip.index = clip.clipX - 1; clip.pos(this.counter.x + 60, this.counter.y); Laya.stage.addChild(clip); } createController() { const Button = Laya.Button; this.controller = new Button(buttonSkin, "暂停"); this.controller.labelBol...

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

6. IDE-显示IDE创建的界面 [ 88%]

...ck); function onBtnClick() { //手动控制组件属性 this.radio.selectedIndex = 1; this.clip.index = 8; this.tab.selectedIndex = 2; this.combobox.selectedIndex = 0; this.check.selected = true; } function onBtn2Click() { //通过赋值可以简单快速修改组件属性 //赋值有两种方式:...

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

7. UI-List [ 87%]

...i/listskins/5.jpg"); } list.array = data; } private updateItem(cell: Item, index: number): void { cell.setImg(cell.dataSource); } private onSelect(index: number): void { console.log("当前选择的索引:" + index); } } import Box = Laya.Box; import Image = Laya.Image; class Item extends Box { pu...

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

8. UI-Tab [ 87%]

... 1,Tab Control 2,Tab Control 3"; tab.labelPadding = "0,0,0,0"; tab.selectedIndex = 1; this.onSelect(tab.selectedIndex); tab.selectHandler = new Handler(this, this.onSelect); Laya.stage.addChild(tab); return tab; } onSelect(index) { console.log("当前选择的标签页索引为 " + index); } } new U...

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

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

...der) { let bodyB: RigidBody = colliderB.owner.getComponent(RigidBody); let index = bodyB.getBody().GetUserData().pointer; this.touching[index] = false; } } dispose() { Laya.physicsTimer.clearAll(this); } } new Physics_Physics_CollisionEvent();package { import laya.display.Sprite; import laya.display...

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

10. UI-RadioGroup [ 81%]

...i) { var rg: RadioGroup = this.createRadioGroup(this.skins[i]); rg.selectedIndex = i; rg.x = i * this.SPACING + this.X_OFFSET; rg.y = this.Y_OFFSET; } } private createRadioGroup(skin: string): RadioGroup { var rg: RadioGroup = new RadioGroup(); rg.skin = skin; rg.space = 70; rg.direction = "v"; rg.l...

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