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

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

21. 文本-字符限制 [ 97%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.createTexts(); } createTexts() { this.createLabel("只允许输入数字:").pos(50, 20); let input = this.createInput(); input.pos(50, 50); input.restrict = "0-9"; this.createLabel("只允许输入字母:").pos(50, 1...

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

22. 文本-滚动文本 [ 97%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.createText(); } createText() { const Text = Laya.Text, Event = Laya.Event; this.txt = new Text(); Laya.stage.addChild(this.txt); this.txt.overflow = Text.SCROLL; this.txt.text = "Layabox是HTML5引擎技术提供商与...

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

23. 加载-销毁Texture使用的图片资源 [ 97%]

...leMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.init(); } init() { const Sprite = Laya.Sprite, Animation = Laya.Animation, Text = Laya.Text, Event = Laya.Event; // 创建背景 this.spBg = Sprite.fromImage(PathBg); Laya.stage.addChild(this.spBg); // 创建动画 this....

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

24. 文本-位图字体 [ 97%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.loadFont(); } loadFont() { const BitmapFont = Laya.BitmapFont, Handler = Laya.Handler; this.bitmapFont = new BitmapFont(); this.bitmapFont.loadFont("res/bitmapFont/test.fnt", new Handler(this, this.onFontLoaded, [this.bi...

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

25. 文本-自动调整文本尺寸 [ 97%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.setup(); } setup() { const Text = Laya.Text; // 该文本自动适应尺寸 var autoSizeText = this.createSampleText(); autoSizeText.overflow = Text.VISIBLE; autoSizeText.y = 50; // 该文本被限制了宽度 var widthL...

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

26. 加载-销毁Texture使用的图片资源 [ 97%]

...。 */ var GameMain = /** @class */ (function () { function GameMain() { this.isDestroyed = false; this.PathBg = "../../res/bg2.png"; this.PathFly = "../../res/fighter/fighter.atlas"; //初始化引擎 Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDL...

来源: Laya_示例 发布时间: 20251130

27. 屏幕适配的缩放模式详解(TypeScript-2D基础篇(TS)-屏幕适配) [ 97%]

...      //设置适配模式         Laya.stage.scaleMode = this.modes;         //设置舞台背景色         Laya.stage.bgColor  = "#ffff99";             //实例一个背景         var bg = new Image();         bg.skin = "res/img/l...

来源: Laya2.0_文档 发布时间: 20200307

28. 鼠标交互-鼠标交互 [ 96%]

...leMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { this.createInteractiveTarget(); this.createLogger(); } createInteractiveTarget() { const Event = Laya.Event, Sprite = Laya.Sprite; let rect = new Sprite(); rect.graphics.drawRect(0, 0, 200, 200, "#D2...

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

29. timer.loop里面修改Text.text在微信小程序上用iPhone打开出现闪屏 [ 96%]

...改Text.text在微信小程序上用iPhone打开出现闪屏 如题,  this.myTest = new Laya.Text() this.myTest.pos(0, 0) this.myTest.size(100, 100) this.myTest.fontSize = 13 this.myTest.color = "#ffffff" this.myTest.align = "center" this.addChild(this.myTest) this.timer.loop(10, this, this.timer...

来源: Laya_社区 发布时间: 20190129

30. 鼠标交互-鼠标交互 [ 96%]

... Laya.stage.addChild(rect); //增加鼠标事件 rect.on(Event.MOUSE_DOWN, this, mouseHandler); rect.on(Event.MOUSE_UP, this, mouseHandler); rect.on(Event.CLICK, this, mouseHandler); rect.on(Event.RIGHT_MOUSE_DOWN, this, mouseHandler); rect.on(Event.RIGHT_MOUSE_UP, this, mouseHandler); rect.on(Event...

来源: Laya_示例 发布时间: 20251130