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

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

801. 屏幕适配问题,ui自适应 [ 68%]

...回复 Laya_Aaron 赞同来自: Laya.stage.scaleMode = Stage.SCALE_FIXED_WIDTH 用这个试试,主要不知道你 需要什么样子的分辨率,这个还是需要自己去做。让这个ui 根据窗口分辨率算一个坐标之类的或者摆放的位置不会被裁剪。ui就是根据窗口...

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

802. 技术文档svg不可以使用 [ 68%]

...data = "data:image/svg+xml," + '<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200">' +'<foreignObject width="100%" height="100%">' +'<div xmlns="http://www.w3.org/1999/xhtml" style="font-size:40px">' +'<em>I</em> like ' +'<span style="color:white; text-...

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

803. iphoneX 用微信打开游戏,,做新手引导 抠图有问题,,, [ 68%]

...skArea.alpha = maskAlpha; this.maskArea.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, maskColor); this.guideContainer.addChild(this.maskArea); //绘制一个圆形区域,利用叠加模式,从遮罩区域抠出可交互区 this.interactionArea = new Sprite(); //设置叠加模式 ...

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

804. laya2.0 截图功能分享,直接截取屏幕上所有对象 [ 68%]

...tatic tempTexture: Laya.Texture; /**截图 */ public static drawScreenshot(width, height, x, y) { if (!SwitchHelper.screenDraw) { return null; }  if (!this.tempTexture2D) { this.tempTexture2D = new Laya.Texture2D(system.width, system.height); } if (!this.tempTexture) { this.tempTexture = new Laya.T...

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

805. 官方新手游戏引导示例中关于hit和unHit的使用疑问 [ 68%]

...用反了。hitArea = new HitArea(); hitArea.hit.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000"); guideContainer.hitArea = hitArea; guideContainer.mouseEnabled = true; hitArea.unHit.clear(); hitArea.unHit.drawCircle(step.x, step.y, step.radius, "#000000");我的理解是给父容器gu...

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

806. textInput的单行输入&多行输入(ActionScript-LayaAir基础篇(AS3)-文本) [ 68%]

...性 y 的值,用于控制 textInput 对象的显示位置。 textInput.width = 300;//设置 textInput 的宽度。 textInput.height = 200;//设置 textInput 的高度。 textInput.bgColor = "#c30c30"; Laya.stage.addChild(textInput);//将 textInput 添加到显示列表。 } private function Text_I...

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

807. Sprite.loadImage在Android平台无法卡死,web和iOS平台正常 [ 68%]

...放置头像, var sp = new Laya.Sprite(); sp.loadImage(url, 0, 0, widget.width, widget.height); //从网络加载图片生成Sprite widget.removeChildren(); // 防止重复提交,把之前生成的头像先删除 widget.addChild(sp); // 添加为只节点 }; 2017-12-29 添加评论 免费帖 -->...

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

808. 在 tiledmap 插入一个精灵在上面 [ 68%]

...this.tiledMap.createMap("desert.json", new Laya.Rectangle(0, 0, Laya.stage.width, Laya.stage.height),   Laya.Handler.create(this,this.loadedMap)); }   loadedMap(){   this.sp=new Laya.Sprite();   this.sp.graphics.drawRect(0,0,100,100,"#FF0000");   var mapLayer = this.tiledMap.getLayerByIndex(1);...

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

809. 微信小游戏开放数据域按钮点击位置偏移 [ 68%]

...etOpenDataContext() var sharedCanvas = openDataContext.canvas sharedCanvas.width = layout.width; sharedCanvas.height = layout.height; //先清空绘制 layout.graphics.clear(false); //设置大小 var canvas = new Laya.Texture(sharedCanvas); canvas.bitmap.alwaysChange = true;//小游戏使用,非...

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

810. Laya List给子元素添加事件后,滚动事件被劫持了 [ 68%]

...t.itemRender = StoreItem;   storeTxList.name = 'storeTxList'; storeTxList.width = 610; storeTxList.pos(0, 0); storeTxList.repeatX = repeatX; storeTxList.repeatY = repeatY; //y轴个数 // 使用但隐藏滚动条 storeTxList.vScrollBarSkin = "store/c.png"; let scrollBar = storeTxList.getChildByName...

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