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

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

1. 文本-位图字体 [ 100%]

...、TypeScript三种开发语言、LayaAirIDE让项目开发更高效。let fontName = "diyFont"; class Text_BitmapFont { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.width, Browser....

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

2. UI-FontClip [ 89%]

...发语言、LayaAirIDE让项目开发更高效。 let assets = ["res/comp/fontClip_num.png", "res/comp/fontClip.png"]; class Font_Clip { constructor() { // 不支持WebGL时自动切换至Canvas const WebGL = Laya.WebGL, Stage = Laya.Stage; Laya.init(800, 600, WebGL); Laya.stage.alignV = Stage.ALIGN...

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

3. 屏幕适配-自动竖屏 [ 84%]

... new Text(); text.text = "Orientation-Portrait"; text.color = "gray"; text.font = "Impact"; text.fontSize = 50; text.x = Laya.stage.width - text.width >> 1; text.y = Laya.stage.height - text.height >> 1; Laya.stage.addChild(text); } } new SmartScale_Portrait();module laya { import Stage = Laya.Stage...

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

4. 屏幕适配-自动横屏 [ 84%]

...new Text(); text.text = "Orientation-Landscape"; text.color = "gray"; text.font = "Impact"; text.fontSize = 50; text.x = Laya.stage.width - text.width >> 1; text.y = Laya.stage.height - text.height >> 1; Laya.stage.addChild(text); } } new SmartScale_Landscape();module laya { import Stage = Laya.Stag...

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

5. UI-TextArea [ 82%]

...st TextArea = Laya.TextArea; 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; impo...

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

6. 文本-HTML文本 [ 82%]

...LDivElement; let p = new HTMLDivElement(); Laya.stage.addChild(p); p.style.font = "Impact"; p.style.fontSize = 30; let html = "使用"; html += "HTMLDivElement"; html += "创建的"; html += "HTML文本"; p.innerHTML = html; } showExternalHTML() { const HTMLIframeElement = Laya.HTMLIframeElement; le...

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

7. 计时器-延迟调用 [ 82%]

...ya.Text; console.log("onCallLater triggered"); let text = new Text(); text.font = "SimHei"; text.fontSize = 30; text.color = "#FFFFFF"; text.text = "打开控制台可见该函数仅触发了一次"; text.size(Laya.stage.width, Laya.stage.height); text.wordWrap = true; text.valign = "middle"; text.a...

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

8. UI-Label [ 80%]

...ROKE_WIDTH = 4; var label = new Label(); Laya.stage.addChild(label); label.font = "Microsoft YaHei"; label.text = "SAMPLE DEMO"; label.fontSize = 30; label.color = color; if (strokeColor) { label.stroke = STROKE_WIDTH; label.strokeColor = strokeColor; } return label; } } new UI_Label();module laya {...

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

9. 文本-复杂的文本样式 [ 80%]

...width = 400; //自动换行 txt.wordWrap = true; txt.align = "center"; txt.fontSize = 40; txt.font = "Microsoft YaHei"; txt.color = "#ff0000"; txt.bold = true; txt.leading = 5; //设置描边属性 txt.stroke = 2; txt.strokeColor = "#ffffff"; txt.borderColor = "#00ff00"; txt.x = (Laya.stage.width - ...

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

10. 文本-自动调整文本尺寸 [ 79%]

....addChild(text); text.overflow = Text.HIDDEN; text.color = "#FFFFFF"; text.font = "Impact"; text.fontSize = 20; text.borderColor = "#FFFF00"; text.x = 80; text.text = "A POWERFUL HTML5 ENGINE ON FLASH TECHNICAL\n" + "A POWERFUL HTML5 ENGINE ON FLASH TECHNICAL\n" + "A POWERFUL HTML5 ENGINE ON FLASH T...

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