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

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

41. 改变画布 样式的 宽高后 鼠标定位问题 [ 74%]

...it(1024, 650 , WebGL); 我改变 宽度后 Render._mainCanvas.source.style.width = "100%" 自适应外部的DIV 但我画笔的定位 this.stage.mouseX 取不到正确位。这怎么处理?   如图,白色画布是1024 x 650  外层div 是 500 x 500 按照鼠标点下去的 位置。在白色画...

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

42. 点击拖动图片,当鼠标移出再移回舞台中时如何保持点击状态 [ 73%]

...显示对象的中心,显示位置在可拖拽区域之内 sp.pivot(sp.width/2,sp.height/2); sp.pos(250,450); Laya.stage.addChild(sp); //为需要滑动的对象添加down,down下开始move,up时移除move和up事件 sp.on(Event.MOUSE_DOWN,this,onDown); Laya.stage.on(Event.MOUSE_UP,this,onUp);...

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

43. 限制区域拖动效果,为什么会无法限制呢? [ 73%]

...per(this)  var dragRegion; showDragRegion(); this.golfBall.x = Laya.stage.width / 2; this.golfBall.y = Laya.stage.height / 2; this.golfBall.on(Event.MOUSE_DOWN, this, onStartDrag)  function showDragRegion() { //拖动限制区域 var dragWidthLimit = 350; var dragHeightLimit = 200; dragRegion = ne...

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

44. 基础文本 · LayaAir3.4 · 引擎文档 · LAYABOX [ 72%]

...t;/li> <li>橘子</li> 定义列表 <img src='image_url' width = 200 height=100/> <img src='atlas/comp/image.png' width = 200 height=100/> 显示一张图片,还可以使用百分比指定图片的大小 <a href='xxx'>link text</a> <a href='www.layabox.com...

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

45. 克隆sprite [ 72%]

...面的“   tempSpr2.graphics.drawTexture(tempSpr.texture, 0, 0, tempSpr.width, tempSpr.height);”中 tempSpr.texture 是空的 if (data && data.items != []) {             let tempSpr: Sprite = new Sprite();             let tempImg: Laya.Image;             let arr: Arr...

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

46. popupEffect 有谁能告诉我dialog的这个东西要怎么用啊? [ 72%]

...log.scale(1, 1);             Tween.from(dialog, {x: Laya.stage.width / 2, y: Laya.stage.height / 2, scaleX: 0, scaleY: 0}, 300, Ease.backOut, Handler.create(this, this.doOpen, [dialog]));         } 2018-06-21 0 2 分享 微博 QZONE 微信 1553745787用户 赞同来自: class Dia...

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

47. 如何实现渐变填充对象呀? [ 71%]

....graphics.drawRect(0, 0, 500, 350, "#ffffff") drawRect(x:Number, y:Number, width:Number, height:Number, fillColor:*, lineColor:* = null, lineWidth:Number = 1):void 参数fillColor:* — 填充颜色,或者填充绘图的渐变对象 我找不到关于这个渐变对象的文档,例子或者教...

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

48. 多行输入文本组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 71%]

...此方法只执行一次 */ 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_文档 发布时间: 20251010

49. Sprite用graphics绘制图形后,mouse_over触发scale显示有问题 [ 70%]

...rite(); this._body.graphics.drawCircle(0, 0, this._objectInfo.templateInfo.width, "#ff0000"); this._body.width = this._objectInfo.templateInfo.width; this._body.height = this._objectInfo.templateInfo.height; this.addChild(this._body); this.on(Event.MOUSE_OVER, this, this.__onMouseOverHole); this.on(...

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

50. 显示文本组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 70%]

...,此方法只执行一次 */ onAwake(): void { this.lab.pos(Laya.stage.width >> 1, Laya.stage.height >> 1); //位置 this.lab.size(500, 30); //大小 this.lab.pivot(this.lab.width/2, this.lab.height/2); //轴心点 this.lab.text = "大家好,欢迎大家来到LayaAir IDE"; //文本...

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