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

大约有 21 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 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_示例 发布时间: 20240930

2. DOM元素-视频 [ 87%]

...rite(); Laya.stage.addChild(reference); reference.pos(100, 100); reference.size(600, 400); reference.graphics.drawRect(0, 0, reference.width, reference.height, "#CCCCCC"); // 每次舞台尺寸变更时,都会调用Utils.fitDOMElementInArea设置Video的位置,对齐的位置和refence重合 Lay...

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

3. 缓动-缓动函数演示 [ 87%]

... Laya.stage.addChild(text); text.pos(x, y); let input = new Input(); input.size(50, 20); input.text = prompt; input.align = 'center'; Laya.stage.addChild(input); input.color = "#FFFFFF"; input.borderColor = "#FFFFFF"; input.pos(text.x + text.width + 10, text.y - 3); input.inputElementYAdjuster = 1; ...

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

4. 鼠标交互-自定义事件 [ 86%]

...is.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); // 侦听自定义的事件 this.sp.on(Event.CLICK, this, this.onSpriteClick); } onSpriteClick(e) { let randomAngle = Math.random() * 180;...

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

5. 文本-字数限制 [ 85%]

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

6. 文本-单行输入 [ 85%]

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

7. 文本-禁止编辑 [ 85%]

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

8. 文本-多行输入 [ 84%]

...行输入 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_示例 发布时间: 20240930

9. UI-TextArea [ 84%]

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

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

...戏发行商\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 ...

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