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

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

41. 分享个用美术资源做位图文本的方法。。。 [ 95%]

...序入口 class GameMain{ constructor() { Laya.init(600,400); var that = this; Laya.loader.load([{"url":"res/playerKpiFont.json","type":Laya.Loader.JSON}, {"url":"res/playerKpiFont.png","type":Laya.Loader.IMAGE}],new Laya.Handler(that,function(){ var jsonData = Laya.loader.getRes("res/playerKpiFont....

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

42. 动画状态脚本(TypeScript-3D基础(TS)-LayaAir3D之Animator动画) [ 95%]

... _text:Laya.Text; constructor() { super(); } get text():Laya.Text { return this._text; } set text(value) { this._text = value; } /** * 动画状态开始时执行。 */ onStateEnter() { console.log("动画开始播放了"); this._text.text = "动画状态:动画开始播放"; } /** * 动画状态...

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

43. 文本-位图字体 [ 95%]

...apFont(); bitmapFont.loadFont("../../res/bitmapFont/test.fnt", new Handler(this, onFontLoaded, [bitmapFont])); } function onFontLoaded(bitmapFont) { bitmapFont.setSpaceWidth(10); Text.registerBitmapFont(fontName, bitmapFont); createText(fontName); } function createText(font) { var txt = new Text(); ...

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

44. 计时器-延迟调用 [ 95%]

...nction demonstrate() { for (var i = 0; i < 10; i++) { Laya.timer.callLater(this, onCallLater); } } function onCallLater() { console.log("onCallLater triggered"); var text = new Text(); text.font = "SimHei"; text.fontSize = 30; text.color = "#FFFFFF"; text.text = "打开控制台可见该函数仅触...

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

45. rigidBody.applyForce 物体不会移动 [ 94%]

...腳色 Laya.Scene3D.load( "res/build5/SampleScene.ls", Laya.Handler.create(this, this.onComplete) ); //射线初始化(必须初始化) this._ray = new Laya.Ray( new Laya.Vector3(0, 0, 0), new Laya.Vector3(0, 0, 0) ); //初始化变量 this.point = new Laya.Vector2(); this._outHitResult = new La...

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

46. 请问如何使我的自定义类UIDropBox继承Laya.Sprite? [ 94%]

... Laya.Sprite; var Text = Laya.Text; function UIDropBox() { UIDropBox.super(this); this.txt = this.getTextFeild(); this.txt.y = 50; this.txt.text = 'aasassa'; console.log(this.addChild);//undefined console.log(this._super);//undefined this.addChild(this.txt); } Laya.class(UIDropBox, "UIDropBox", Spri...

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

47. 文本-字符限制 [ 94%]

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

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

48. 骨骼动画进阶(TypeScript-2D进阶篇(TS)-动画进阶) [ 94%]

...ructor() { Laya.WebGL.enable(); Laya.init(1000, 900); //创建动画模板 this.templet = new Laya.Templet(); this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete); this.templet.on(Laya.Event.ERROR, this, this.onError); this.templet.loadAni("res/spine/goblins/goblins.sk"); } onError() { con...

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

49. DOM元素-表单输入 [ 94%]

...; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#fff"; this.form = new Laya.Sprite(); this.form.size(250,120); this.form.pos((Laya.stage.width - this.form.width) / 2, (Laya.stage.height - this.form.height) / 2); Laya.stage.addChild(this.form); this.rowHeight = 30; this.rowSpacing...

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

50. 鼠标交互-修正交互区域 [ 94%]

...leMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { this.buildWorld(); this.createLogger(); } buildWorld() { const Event = Laya.Event; this.createCoralRect(); this.createDeepSkyblueRect(); this.createDarkOrchidRect(); // 设置舞台 Laya.stage.name =...

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