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

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

1. UI-ProgressBar [ 100%]

... = new Handler(this, this.onChange); Laya.timer.loop(100, this, this.changeValue); } changeValue() { if (this.progressBar.value >= 1) { this.progressBar.value = 0; } this.progressBar.value += 0.05; } onChange(value) { console.log("进度:" + Math.floor(value * 100) + "%"); } } new UI_ProgressBar()...

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

2. UI-FontClip [ 97%]

...os(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(150, 200); clipnum1.direction = "vertical"; clipnum1.sheet = "0123456789"; cli...

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

3. UI-Slider [ 96%]

...ddChild(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.stage.addChild(vs); vs.skin = "res/ui/vslider...

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

4. UI-ScrollBar [ 92%]

...max = 100; vs.changeHandler = new Handler(this, this.onChange); } onChange(value) { console.log("滚动条的位置: value=" + value); } } new UI_ScrollBar();module laya { import Stage = Laya.Stage; import HScrollBar = Laya.HScrollBar; import VScrollBar = Laya.VScrollBar; import Handler = Laya.Han...

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

5. 性能测试-卡通人物2 [ 87%]

...this.nameLabel.align = "center"; this.addChild(this.nameLabel); } setSpeed(value) { this.speed = value; } setName(value) { this.nameLabel.text = value; } update() { this.x += this.speed; if (this.x >= Laya.stage.width + Character.WIDTH) this.x = -Character.WIDTH; } } Character.WIDTH = 110; Character...

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

6. 缓动-缓动函数演示 [ 78%]

... = 12; this.label.color = "#FFFFFF"; this.addChild(this.label); } setLabel(value) { this.label.text = value; } } new Tween_EaseFunctionsDemo();module laya { import Input = Laya.Input; import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Text = Laya.Text; import Event = Laya.Event; import L...

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

7. 鼠标交互-鼠标交互 [ 77%]

...OUSE_WHEEL: this.appendText("\n鼠标滚轮滚动"); break; } } appendText(value) { txt.text += value; txt.scrollY = txt.maxScrollY; } /**添加提示文本*/ createLogger() { const Text = Laya.Text; txt = new Text(); txt.overflow = Text.SCROLL; txt.text = "请把鼠标移到到矩形方块,左右...

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

8. IDE-显示IDE创建的界面 [ 71%]

...: //简单赋值,比如:progress:0.2,就是更改progress组件的value为2 //复杂复制,可以通知某个属性,比如:label:{color:"#ff0000",text:"Hello LayaAir"} this.box.dataSource = {slider: 50, scroll: 80, progress: 0.2, input: "This is a input", label: {color: "#ff0000", text...

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

9. UI-RefreshList [ 56%]

...height = 80; } get dataSource(){ return super.dataSource; } set dataSource(value) { super.dataSource = value; if (!value) return; this.LmsgTime.changeText(value.msgTime.text); this.LmsgTitle.changeText(value.msgTitle.text); this.redHot.visible = value.avatar.redHot.visible; } }

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