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

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

141. 多重遮罩显示异常 [ 82%]

...ructor() { super(); this.init(); } init() { let bg = new Laya.Sprite(); bg.graphics.drawRect(0, 0, 500, 500, '#aaa'); this.addChild(bg); this.panel = new Laya.Panel(); this.panel.width = 500; this.panel.height = 500; this.panel.vScrollBarSkin = ''; this.panel.hScrollBarSkin = ''; this.addChild(this....

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

142. 鼠标交互-双指旋转(多点触控) [ 82%]

...); } function createSprite() { sp = new Sprite(); var w = 200, h = 300; sp.graphics.drawRect(0, 0, w, h, "#FF7F50"); sp.size(w, h); sp.pivot(w / 2, h / 2); sp.pos(Laya.stage.width / 2, Laya.stage.height / 2); Laya.stage.addChild(sp); sp.on(Event.MOUSE_DOWN, this, onMouseDown); } function onMouseDown...

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

143. 显示与切换图片(JavaScript-LayaAir基础篇(JS)-位图) [ 82%]

...游戏开发基础,本篇从API到示例分别介绍Sprite.loadImage与Graphics.drawTexture两种显示图片的方法。 ## 1、用loadImage方法显示与切换图片 ### 1.1 loadImage API概述 在API文档中搜索laya.display.Sprite,可以找到loadImage()方法,如图1所示,我们先...

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

144. hitArea怎么用 [ 81%]

hitArea怎么用 var container = new Sprite();         container.graphics.drawRect(0,0,640,1136,'#ff0000');         container.size(640,1136)         Laya.stage.addChild(container);                       var bg2Sprite =  new Sprite();         bg2Sprite.graphics.drawRect(...

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

145. 裁切图片后,该用什么方式去重绘出裁切后的图片 [ 81%]

...绘的切下来的部分,但黄色的原图一直还在,即便调用了graphics.clear()方法   这是我重绘部分的代码,我是应该用sprite.graphics去重绘,还是该调用Laya.Render.context中的方法去重绘,绘制部分代码如下(points,是我裁切后的多边形位...

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

146. Text的中划线(删除线) [ 81%]

...         y+=this._charSize.height;             this._graphics.drawLine(x,y,x+lineWidth,y,this.underlineColor || this.color,1);         } y  如果  y+=this._charSize.height/2;  就是中划线  可以自己加个变量 控制 例如  linethrough   如果是 true...

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

147. Panel控件滑动区域不正常的问题 [ 81%]

...unction () { var content=this._content; var rect = new Laya.Sprite(); rect.graphics.drawRect(0, 0, this.contentWidth, this.contentHeight, "#000000"); content.hitArea = new Laya.HitArea(); content.hitArea.hit = rect.graphics; } 然后分别在panel的“setContentSize”和“changeScroll”方法的...

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

148. 绘制图形的BUG [ 81%]

...nds Sprite { private var _shape:Sprite; public function MyBox() { super(); graphics.drawRect(0,0,200,200,"#00ff00"); _shape=new Sprite(); _shape.graphics.drawCircle(0,0,20,"#ff0000"); addChild(_shape); //加上这句正常,反之则异常 //_shape.cacheAsBitmap=true; pos(300,300); Tween.to(this,{r...

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

149. 小游戏安卓不支持filters [ 81%]

...通过手指的移动去绘制线条 下面是部分代码 this.cutLayer.graphics.clear(); for(i = this.lines.length - 1; i >= 0; i--){ var line = this.lines[i]; line.state++; if(line.state > 7){ this.lines.splice(i, 1); } this.cutLayer.graphics.drawLine(line.x1, line.y1, line.x2, line.y2, "#f...

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

150. 为什么显示不了 [ 81%]

为什么显示不了 var sp = new Laya.Sprite(); sp.graphics.drawRect(this.mouse_x, this.mouse_y, 10, 10, "#ff0000"); //var htmlC:Laya.HTMLCanvas = sp.drawToCanvas(375,440,0,0).getCanvas().toDataURL(); var htmlCanvas:Laya.HTMLCanvas = sp.drawToCanvas(375,440,0,0); var texture:Laya.Texture = new La...

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