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

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

1. 鼠标交互-自定义事件 [ 100%]

...vent = Laya.Event; this.sp = new Sprite(); this.sp.graphics.drawRect(0, 0, 200, 200, "#D2691E"); this.sp.pivot(100, 100); this.sp.x = Laya.stage.width / 2; this.sp.y = Laya.stage.height / 2; this.sp.size(200, 200); Laya.stage.addChild(this.sp); this.sp.on(ROTATE, this, this.onRotate); // 侦听自...

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

2. 鼠标交互-鼠标交互 [ 98%]

...prite = Laya.Sprite; let rect = new Sprite(); rect.graphics.drawRect(0, 0, 200, 200, "#D2691E"); rect.size(200, 200); rect.x = (Laya.stage.width - 200) / 2; rect.y = (Laya.stage.height - 200) / 2; Laya.stage.addChild(rect); //增加鼠标事件 rect.on(Event.MOUSE_DOWN, this, this.mouseHandler); rec...

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

3. UI-FontClip [ 97%]

...123456789"; 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.pos(240, 300); fontCli...

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

4. 屏幕适配-缩放-No Border [ 95%]

....Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } updateRectPos() { this.rect.x = Laya.stage.width / 2; this.rect.y = Laya.stage.height / 2; } } new SmartScale_Scale_NOBORDER();module laya { import Sp...

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

5. 屏幕适配-缩放-No Scale [ 95%]

....Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } updateRectPos() { this.rect.x = Laya.stage.width / 2; this.rect.y = Laya.stage.height / 2; } } new SmartScale_Scale_NOSCALE();module laya { import Spr...

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

6. 屏幕适配-缩放-Extract Fit [ 95%]

....Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } updateRectPos() { this.rect.x = Laya.stage.width / 2; this.rect.y = Laya.stage.height / 2; } } new SmartScale_Scale_EXTRACT_FIT();module laya { import...

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

7. 屏幕适配-缩放-Show All [ 95%]

....Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } updateRectPos() { this.rect.x = Laya.stage.width / 2; this.rect.y = Laya.stage.height / 2; } } new SmartScale_Scale_SHOW_ALL();module laya { import Sp...

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

8. 计时器-间隔循环 [ 87%]

...rotateTimeBasedText.x, this.rotateTimeBasedText.y + vGap); Laya.timer.loop(200, this, this.animateTimeBased); Laya.timer.frameLoop(2, this, this.animateFrameRateBased); } createText(text, x, y) { const Text = Laya.Text; let t = new Text(); t.text = text; t.fontSize = 30; t.color = "white"; t.bold = ...

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

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

...me = "暗紫色矩形容器"; darkOrchidRect.graphics.drawRect(-100, -100, 200, 200, "#9932CC"); darkOrchidRect.pos(Laya.stage.width / 2, Laya.stage.height / 2); Laya.stage.addChild(darkOrchidRect); // 为true时,碰撞区域会被修正为实际显示边界 // mouseThrough命名真是具有强烈...

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

10. UI-RadioGroup [ 84%]

...言、LayaAirIDE让项目开发更高效。let SPACING = 150, X_OFFSET = 200, Y_OFFSET = 200, skins; class UI_RadioGroup { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler; // 不支持WebGL时自动切换至Canvas Laya.in...

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