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

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

1. 鼠标交互-修正交互区域 [ 100%]

..., "#FF7F50"); //设置名称 coralRect.name = "珊瑚色容器"; 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...

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

2. Sprite-屏幕截图 [ 99%]

...kin,name); Laya.stage.addChild(btn); btn.on(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 = ["canva...

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

3. UI-Clip [ 91%]

...r(); } showBg() { const Image = Laya.Image; let bg = new Image(bgSkin); bg.size(224, 302); bg.pos(Laya.stage.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.ad...

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

4. 文本-字数限制 [ 89%]

...ut; let inputText = new Input(); Laya.stage.addChild(inputText); inputText.size(350, 100); inputText.x = Laya.stage.width - inputText.width >> 1; inputText.y = Laya.stage.height - inputText.height >> 1; // 设置字体样式 inputText.bold = true; inputText.bgColor = "#666666"; inputText.color = "#f...

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

5. 文本-单行输入 [ 89%]

...ut; var inputText = new Input(); Laya.stage.addChild(inputText); inputText.size(350, 100); inputText.x = Laya.stage.width - inputText.width >> 1; inputText.y = Laya.stage.height - inputText.height >> 1; // 移动端输入提示符 inputText.prompt = "Type some word..."; // 设置字体样式 inputTe...

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

6. 文本-禁止编辑 [ 88%]

...ut; let inputText = new Input(); Laya.stage.addChild(inputText); inputText.size(350, 100); inputText.x = Laya.stage.width - inputText.width >> 1; inputText.y = Laya.stage.height - inputText.height >> 1; inputText.text = "这段文本不可编辑,但可复制"; inputText.editable = false; // 设置...

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

7. 文本-多行输入 [ 88%]

...行输入 inputText.multiline = true; inputText.wordWrap = true; inputText.size(350, 100); inputText.x = Laya.stage.width - inputText.width >> 1; inputText.y = Laya.stage.height - inputText.height >> 1; inputText.padding = [2,2,2,2]; // 移动端输入提示符 inputText.prompt = "Type some word..."...

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

8. 输入设备-贪吃蛇(重力感应) [ 87%]

...ood = new Sprite(); Laya.stage.addChild(food); foods.push(food); const foodSize = 40; food.size(foodSize, foodSize); food.graphics.drawRect(0, 0, foodSize, foodSize, "#00BFFF"); food.x = Math.random() * Laya.stage.width; food.y = Math.random() * Laya.stage.height; } } class Segment extends Laya.Spri...

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

9. UI-TextArea [ 87%]

...Area; let ta = new TextArea(""); ta.skin = skin; ta.font = "Arial"; ta.fontSize = 18; ta.bold = true; ta.color = "#3d3d3d"; ta.pos(100, 15); ta.size(375, 355); ta.padding = "70,8,8,8"; Laya.stage.addChild(ta); } } new UI_TextArea();module laya { import Stage = Laya.Stage; import TextArea = Laya.Text...

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

10. 输入设备-地图 [ 87%]

...lay(marker); let label = new BMap.Label("当前位置", { offset: new BMap.Size(-15, 30) }); marker.setLabel(label); } createInfoText() { const Text = Laya.Text; infoText = new Text(); Laya.stage.addChild(infoText); infoText.fontSize = 50; infoText.color = "#FFFFFF"; infoText.size(Laya.stage.width, ...

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