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

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

1. 文本-Overflow [ 100%]

...Stat = Laya.Stat; // 不支持WebGL时自动切换至Canvas Laya.init(600, 300, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.createInput(); } createInput() { const Text = Laya....

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

2. UI-Slider [ 99%]

...s = new 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();...

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

3. UI-ScrollBar [ 98%]

...Bar(); Laya.stage.addChild(hs); hs.skin = "res/ui/hscroll.png"; hs.width = 300; hs.pos(50, 170); hs.min = 0; hs.max = 100; hs.changeHandler = new Handler(this, this.onChange); } placeVScroller() { const VScrollBar = Laya.VScrollBar, Handler = Laya.Handler; let vs = new VScrollBar(); Laya.stage.addCh...

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

4. 缓动-时间线 [ 94%]

...eY:0.5}, 2000, null, 0) .addLabel("turnDown", 0).to(this.target, {x:450, y:300, scaleX:0.2, scaleY:1, alpha:1}, 2000, null, 0) .addLabel("turnLeft", 0).to(this.target, {x:100, y:300, scaleX:1, scaleY:0.2, alpha:0.1}, 2000, null, 0) .addLabel("turnUp", 0).to(this.target, {x:100, y:100, scaleX:1, scal...

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

5. 鼠标交互-双指缩放(多点触控) [ 94%]

...} createSprite() { const Sprite = Laya.Sprite, Event = Laya.Event; let w = 300, h = 300; this.sp = new Sprite(); Laya.stage.addChild(this.sp); this.sp.graphics.drawRect(0, 0, w, h, "#FF7F50"); this.sp.size(w, h); this.sp.pivot(w / 2, h / 2); this.sp.pos(Laya.stage.width / 2, Laya.stage.height / 2); ...

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

6. UI-Input [ 93%]

...、LayaAirIDE让项目开发更高效。let SPACING = 100, INPUT_WIDTH = 300, INPUT_HEIGHT = 50, Y_OFFSET = 50, skins; class UI_Input { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler; // 不支持WebGL时自动切换至C...

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

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

...e; sensorCollider.radius = 100; sensorCollider.x = 450; sensorCollider.y = 300; for (let i = 0, len = this.count; i = []; private touching: Array = []; constructor(maincls: typeof Main) { this.Main = maincls; Laya.Config.isAntialias = true; Laya.init(1200, 700, WebGL); Stat.show(); Physics.enable();...

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

8. 文本-自动换行 [ 89%]

...,面向AS/JS/TS开发者提供HTML5开发技术方案!"; txt.width = 300; txt.fontSize = 40; txt.color = "#ffffff"; // 设置文本是否自动换行 txt.wordWrap = true; txt.x = Laya.stage.width - txt.textWidth >> 1; txt.y = Laya.stage.height - txt.textHeight >> 1; } } new Text_Scroll();module ...

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

9. 2D物理-桥 [ 87%]

...pointRB1; let width = 20, height = 2.5; for (let i = 0; i { let targetX = (300 + Math.random() * 400) / Laya.Physics.PIXEL_RATIO, targetY = 500 / Laya.Physics.PIXEL_RATIO; let newBall = new Laya.Sprite(); Laya.Laya.stage.addChild(newBall); let circleBody = newBall.addComponent(Laya.RigidBody); circl...

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

10. 文本-下划线 [ 87%]

...发行商\n面向AS/JS/TS开发者提供HTML5开发技术方案"; txt.size(300, 50); txt.fontSize = 20; txt.color = "#ffffff"; txt.align = align; // 设置下划线 txt.underline = true; txt.underlineColor = underlineColor; txt.pos(x, y); return txt; } } new Text_Underline();module laya { import Sta...

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