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

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

221. 输入文本组件 · LayaAir3.0文档 · LAYABOX [ 96%]

...组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.txtin.pos(Laya.stage.width >> 1, Laya.stage.height >> 1); //位置 this.txtin.size(500, 60); //大小 this.txtin.pivot(this.txtin.width/2, this.txtin.height/2); //轴心点 this.txtin.font = "宋体"; //字体 ...

来源: Laya3.0_文档 发布时间: 20230629

222. oppo CanvasRenderingContext2D 并没有实现 drawImage;报错; [ 96%]

...premultiplyAlpha=false); var width=source.width; var height=source.height; this._width=width; this._height=height; this._setWarpMode(/*laya.webgl.WebGLContext.TEXTURE_WRAP_S*/0x2802,this._wrapModeU); this._setWarpMode(/*laya.webgl.WebGLContext.TEXTURE_WRAP_T*/0x2803,this._wrapModeV); this._setFilter...

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

223. 2.0label不改变文本内容,label颜色无法直接改变,1.0可以 [ 96%]

...的不同,label才会改变颜色 开启stroke就会出现这种情况   this.label = new Label();             this.label.text = "王小二的摊位";             this.label.fontSize = 15;             this.label.color = "#7CFC00";             this.lab...

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

224. 飞机大战出现的问题注册了类New的时候报错未定义 [ 96%]

...错未定义 var Game=(function(){ (function Game(){ Laya.init(400,852); this.bg = new BackGround(); //把背景添加到舞台上显示出来 Laya.stage.addChild(this.bg);  })();     })();   //循环滚动的游戏背景 var BackGround = (function(_super){ function BackGround(){ BackGround.sup...

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

225. Sprite-新手引导 [ 96%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.createPage(); } createPage() { const Sprite = Laya.Sprite; // 绘制底图 gameContainer = new Sprite(); Laya.stage.addChild(gameContainer); gameContainer.loadImage("res/guide/crazy_snowball.png"); gameContainer.on(Laya....

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

226. 设置滤镜(TypeScript-LayaAir基础篇(TS)-位图) [ 95%]

...ge.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; Laya.loader.load(this.ApePath, Handler.create(this, this.setup)); } private setup(): void { this.normalizeApe(); this.makeRedApe(); this.grayingApe(); } private normalizeApe(): void { var originalApe: Sprite = this.createApe(); this.apeTextur...

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

227. WebSocket发送与接收数据(ActionScript-LayaAir基础篇(AS3)-数据与通信) [ 95%]

...e; public function Game() { //初始化引擎 Laya.init(600, 400,WebGL);// this.byte = new Byte(); this.byte.endian = Byte.LITTLE_ENDIAN;//这里我们采用小端; this.socket = new Socket(); this.socket.endian = Byte.LITTLE_ENDIAN;//这里我们采用小端; this.socket.connectByUrl("ws://loca...

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

228. 滤镜-发光滤镜 [ 95%]

...a.stage.bgColor = "#232628"; Laya.loader.load(apePath, Laya.Handler.create(this, this.setup)); } setup() { this.createApe(); this.applayFilter(); } createApe() { const Sprite = Laya.Sprite; this.ape = new Sprite(); Laya.stage.addChild(this.ape); let texture = Laya.loader.getRes(apePath); this.ape.gr...

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

229. 多行输入文本组件 · LayaAir3.0文档 · LAYABOX [ 95%]

...组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.txtarea.pos(Laya.stage.width >> 1, Laya.stage.height >> 1); //位置 this.txtarea.size(500, 200); //大小 this.txtarea.pivot(this.txtarea.width/2, this.txtarea.height/2); //轴心点 this.txtarea.text = "大...

来源: Laya3.0_文档 发布时间: 20230629

230. 2D物理-复合碰撞器 [ 95%]

...让项目开发更高效。class Physics_Physics_Tumbler { constructor() { this.count = 0; this.totalBox = 200; Laya.Config.isAntialias = true; Laya.Laya.init(Laya.Browser.clientWidth, Laya.Browser.clientHeight, Laya.WebGL); Laya.Stat.show(); Laya.Physics.enable({ gravity: 0 }); Laya.PhysicsDebugDra...

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