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

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

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

...(tick > frequency) { tick = 0; // iterate through the dudes and update the positions laser = new Sprite(); laser.loadImage("res/pixi/laser0" + ((type % 5) + 1) + ".png"); type++; laser.life = 0; let pos1; let pos2; if (type % 2) { pos1 = new Point(-20, Math.random() * viewHeight); pos2 = new Point(v...

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

2. 文本-字符限制 [ 96%]

...ateTexts(); } createTexts() { this.createLabel("只允许输入数字:").pos(50, 20); let input = this.createInput(); input.pos(50, 50); input.restrict = "0-9"; this.createLabel("只允许输入字母:").pos(50, 100); input = this.createInput(); input.pos(50, 130); input.restrict = "a-zA-Z"; thi...

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

3. UI-FontClip [ 93%]

...= new FontClip(assets[0]); var clipnum1 = new FontClip(assets[0]); clipnum.pos(240, 500); clipnum.size(250, 50); clipnum.sheet = "0123456789"; clipnum.value = "114499"; clipnum.spaceY = 10; TestClipNum.pos(200, 400); TestClipNum.sheet = "0123456789"; TestClipNum.value = "0123456789"; clipnum1.pos(15...

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

4. UI-RefreshList [ 86%]

....scrollBarIsStop=false; /** 移动前的上次坐标位置 */ this.moveLastPos = null; /** 列表单元是否已打开 */ this.itemIsOpen=false; /**展开的单元格索引ID */ this.itemOpenId=-1; /**展开的单元格对象 */ this.openedItem = null; /** 记录模拟数据的红点状态 */ this.r...

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

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

...imation(); this.aniFly.loadAtlas(PathFly); this.aniFly.play(); this.aniFly.pos(250, 100); Laya.stage.addChild(this.aniFly); // 创建按钮 this.btn = new Sprite().size(205, 55); this.btn.graphics.drawRect(0, 0, this.btn.width, this.btn.height, "#057AFB"); this.txt = new Text(); this.txt.text = "销...

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

6. Sprite-容器 [ 85%]

...addChild(ape); ape.loadImage(`res/apes/monkey${i}.png`); ape.pivot(55, 72).pos( Math.cos(radianUnit * i) * layoutRadius, Math.sin(radianUnit * i) * layoutRadius ); } this.apesCon.pos(Laya.stage.width / 2, Laya.stage.height / 2); Laya.timer.frameLoop(1, this, this.animate); } animate() { this.apesCon...

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

7. Sprite-节点控制 [ 84%]

...(monkey2Path); this.ape1.pivot(55, 72); this.ape2.pivot(55, 72); this.ape1.pos(Laya.stage.width / 2, Laya.stage.height / 2); this.ape2.pos(200, 0); // 一只猩猩在舞台上,另一只被添加成第一只猩猩的子级 Laya.stage.addChild(this.ape1); this.ape1.addChild(this.ape2); Laya.timer.fr...

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

8. Sprite-轴心点 [ 84%]

...nkey2Path); // 设置轴心点为中心 this.ape1.pivot(55, 72); this.ape1.pos(Laya.stage.width / 2 - gap, Laya.stage.height / 2); // 不设置轴心点默认为左上角 this.ape2 = new Sprite(); Laya.stage.addChild(this.ape2); this.ape2.loadImage(monkey2Path); this.ape2.pos(Laya.stage.width / 2 + ...

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

9. UI-Tab [ 84%]

...SkinLoaded)); } onSkinLoaded() { let tabA = this.createTab(skins[0]); tabA.pos(40, 120); tabA.labelColors = "#000000,#d3d3d3,#333333"; let tabB =this. createTab(skins[1]); tabB.pos(40, 220); tabB.labelColors = "#FFFFFF,#8FB299,#FFFFFF"; } createTab(skin) { const Tab = Laya.Tab, Handler = Laya.Handle...

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

10. UI-Slider [ 83%]

...HSlider("res/ui/hslider.png"); Laya.stage.addChild(hs); hs.width = 300; hs.pos(50, 170); hs.min = 0; hs.max = 100; hs.value = 50; hs.tick = 1; hs.changeHandler = new Handler(this, this.onChange); } placeVSlider() { const VSlider = Laya.VSlider, Handler = Laya.Handler; let vs = new VSlider(); Laya.st...

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