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

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

1. UI-FontClip [ 100%]

...龙蛇马羊猴鸡狗猪年快乐"; TestFontClip.spaceY = 10; Laya.stage.addChild(clipnum); Laya.stage.addChild(fontClip); Laya.stage.addChild(TestFontClip); Laya.stage.addChild(TestClipNum); Laya.stage.addChild(clipnum1); } } new Font_Clip(); module laya{ import Stage=Laya.Stage; import FontClip=La...

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

2. Sprite-新手引导 [ 98%]

...te = Laya.Sprite; // 绘制底图 gameContainer = new Sprite(); Laya.stage.addChild(gameContainer); gameContainer.loadImage("res/guide/crazy_snowball.png"); gameContainer.on(Laya.Event.CLICK, this, this.nextStep); // 引导所在容器 guideContainer = new Sprite(); Laya.stage.addChild(guideContaine...

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

3. 缓动-缓动函数演示 [ 96%]

...acter() { 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 = new List(); easeFunctionsLi...

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

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

...ya.Event; // 创建背景 this.spBg = Sprite.fromImage(PathBg); Laya.stage.addChild(this.spBg); // 创建动画 this.aniFly = new Animation(); this.aniFly.loadAtlas(PathFly); this.aniFly.play(); this.aniFly.pos(250, 100); Laya.stage.addChild(this.aniFly); // 创建按钮 this.btn = new Sprite().size...

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

5. UI-Clip [ 95%]

...age.width - bg.width >> 1, Laya.stage.height - bg.height >> 1); Laya.stage.addChild(bg); } createTimerAnimation() { const Clip = Laya.Clip; this.counter = new Clip(clipSkin, 10, 1); Laya.stage.addChild(this.counter); this.counter.autoPlay = true; this.counter.interval = 1000; this.counter.x = (Laya....

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

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

...器"; coralRect.size(Laya.stage.width, Laya.stage.height / 2); Laya.stage.addChild(coralRect); coralRect.on(Event.MOUSE_DOWN, this, this.onDown); } createDeepSkyblueRect() { const Sprite = Laya.Sprite, Event = Laya.Event; let deepSkyblueRect = new Sprite(); deepSkyblueRect.graphics.drawRect(0, 0, 10...

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

7. 屏幕适配-屏幕适配 [ 95%]

...例一个背景 let bg = new Image(); bg.skin = "res/bg.jpg"; Laya.stage.addChild(bg); //实例一个文本 this.txt = new Text(); this.txt.text = "点击我切换适配模式(noscale)"; this.txt.bold = true; this.txt.pos(0, 200); this.txt.fontSize = 30; this.txt.on("click", this, this.onTxtClick); ...

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

8. 2D物理-桥 [ 94%]

...sX = 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); chainCollider.points = "50,600,1050,600...

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

9. UI-Tree [ 94%]

...ree.width) / 2; tree.y = (Laya.stage.height - tree.height) / 2; Laya.stage.addChild(tree); } } const Box = Laya.Box, Clip = Laya.Clip, Label = Laya.Label; // 此类对应的json对象: // {"child": [{"type": "Clip", "props": {"x": "13", "y": "0", "left": "12", "height": "24", "name": "selectBox", ...

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

10. 输入设备-指南针 [ 93%]

...pass() { const Sprite = Laya.Sprite; compassImg = new Sprite(); Laya.stage.addChild(compassImg); compassImg.loadImage(compassImgPath); compassImg.pivot(compassImg.width / 2, compassImg.height / 2); compassImg.pos(Laya.stage.width / 2, 400); } createDirectionIndicator() { const Sprite = Laya.Sprite; ...

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