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

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

1. 文本-Overflow [ 100%]

... Laya.Text; let t1 = this.createText(); t1.overflow = Text.VISIBLE; t1.pos(10, 10); let t2 = this.createText(); t2.overflow = Text.SCROLL; t2.pos(10, 110); let t3 = this.createText(); t3.overflow = Text.HIDDEN; t3.pos(10, 210); } createText() { const Text = Laya.Text; let txt = new Text(); txt.text ...

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

2. Sprite-绘制各种形状 [ 96%]

... new Laya.Sprite(); Laya.stage.addChild(sp); //画线 sp.graphics.drawLine(10, 58, 146, 58, "#ff0000", 3); //画连续直线 sp.graphics.drawLines(176, 58, [0, 0, 39, -50, 78, 0, 117, 50, 156, 0], "#ff0000", 5); //画曲线 sp.graphics.drawCurves(352, 58, [0, 0, 19, -100, 39, 0, 58, 100, 78, 0, 97, ...

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

3. UI-FontClip [ 94%]

...; clipnum.sheet = "0123456789"; clipnum.value = "114499"; clipnum.spaceY = 10; TestClipNum.pos(200, 400); TestClipNum.sheet = "0123456789"; TestClipNum.value = "0123456789"; clipnum1.pos(150, 200); clipnum1.direction = "vertical"; clipnum1.sheet = "0123456789"; clipnum1.value = "223388"; fontClip.po...

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

4. 输入设备-摇一摇 [ 90%]

...r = Laya.Handler; // 不支持WebGL时自动切换至Canvas Laya.init(700, 1024, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.showShakePic(); this.showConsoleText(); this.start...

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

5. 性能测试-骨骼 [ 88%]

...。let mArmature, fileName = "Dragon", mTexturePath, mAniPath, rowCount = 10, colCount = 10, xOff = 50, yOff = 100, mSpacingX, mSpacingY, mAnimationArray = [], mFactory, mActionIndex = 0; class PerformanceTest_Skeleton { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya....

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

6. UI-Clip [ 84%]

...merAnimation() { 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.stage.width - this.counter.width) / 2 - 35; this.counter.y = (Laya.stage.height - this.counter.heig...

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

7. 鼠标交互-修正交互区域 [ 84%]

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

8. Sprite-屏幕截图 [ 84%]

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

9. 缓动-缓动函数演示 [ 80%]

...racter); character.loadImage("res/cartoonCharacters/1.png"); character.pos(100, 50); } createEaseFunctionList() { const List = Laya.List, Handler = Laya.Handler; let easeFunctionsList = new List(); easeFunctionsList.itemRender = ListItemRender; easeFunctionsList.pos(5, 5); easeFunctionsList.repeatX ...

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

10. 计时器-延迟调用 [ 80%]

...8"; Stat.show(); this.demonstrate(); } demonstrate() { for (let i = 0; i < 10; i++) { Laya.timer.callLater(this, this.onCallLater); } } onCallLater() { const Text = Laya.Text; console.log("onCallLater triggered"); let text = new Text(); text.font = "SimHei"; text.fontSize = 30; text.color = "#FFFFFF...

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