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

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

401. 圆不跟谁 sprite 一起缩放? [ 78%]

...otSp = new Laya.Sprite();  this.firstSp = new Laya.Sprite(); this.firstSp.graphics.drawRect(0, -100, 200, 200, null, "#ffffff"); this.firstSp.graphics.drawLine(0, 0, 100, 100, "#ffffff", 5); this.firstSp.graphics.drawCircle(100, 100, 20, null, "ffffff"); Laya.stage.on(Laya.Event.MOUSE_WHEEL, this, ...

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

402. 关于removeChildren、 destroy和destroyChildren的疑惑 [ 78%]

...n sightBeadSprite() { SightBead.super(this); this.name = 'sightBead'; this.graphics.drawCircle(0,0,40,null,'#ff0000',1); this.graphics.drawLine(-45,0,45,0,'#ff0000',1); this.graphics.drawLine(0,45,0,-45,'#ff0000',1); this.alpha = 0; Laya.stage.addChild(this); // this.pos(440,640); } Laya.class(sight...

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

403. Laya1.6.2发布flash版本 [ 78%]

...9() at Function/http://adobe.com/AS3/2006/builtin::call() at laya.display::Graphics/_renderOne() at laya.renders::RenderSprite/_graphics() at laya.display::Sprite/render() at laya.renders::RenderSprite/_childs() at Function/http://adobe.com/AS3/2006/builtin::call() at laya.renders::RenderSprite/_gra...

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

404. LayaAir 2.0 微信排行榜 离屏画布不能直接附加到组件纹理上 [ 78%]

...件纹理上 A:let texture = new Laya.Texture(sharedCanvas); backImage.graphics.drawTexture(texture)   B:backImage.texture = texture     1.7版本可以直接把共享画布赋值给组件纹理,2.0不行(A,B两种方法) 报如下错误:   value._addReference is not a function ...

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

405. 代码创建精灵监听不到事件? [ 78%]

...var box = new Laya.Sprite(); var texture = Laya.loader.getRes(boxstr); box.graphics.drawTexture(texture); var arr = {data: StorageRoom.map_storageData[0][0],tag:0}; box.on(Laya.Event.MOUSE_UP,this,this.onclick,[arr]);   var _proto = StorageUILayer.prototype;   _proto.onclick = function(params){ co...

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

406. Laya对骨骼插槽添加滤镜 [ 78%]

...的渲染中,会遍历所有的插槽,调用BoneSlot中的draw方法(graphics.drawTexture和graphics.drawSkin) ,将插槽中的纹理通过封装cmd的形式通过方法加入_cmd的队列中,通过_renderAll遍历执行所有_cmd队列中的指令进行渲染从而更新画面 。可以...

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

407. 鼠标事件能否在有图形的区域感应,特别是子项坐标为负数时(已经找到问题) [ 77%]

...ite { private var testPan:Sprite; public function MainUi() { super(); this.graphics.drawRect(0,0,500,500,"#fff0cc"); testPan = new Sprite(); testPan.name = "testPan"; this.addChild( testPan ); testPan.pos( 300,300); testPan.graphics.drawRect(0,0,90,100,"#faaff0"); testPan.on(Event.CLICK,this,onMouse...

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

408. 关于适配有点疑惑 [ 77%]

...tralRect(); })(); function createCantralRect() { rect = new Sprite(); rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(rect); var rect1 = new Sprite(); rect1.graphics.drawRect(Laya.stage.width / 3 * 2 , Laya.stage.height / 3 * 2 - 65, 100, 100, "blue"); // rect1.graphics.dra...

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

409. HTMLDivElement下划线换行时,下划线颜色错误 [ 77%]

...代码造成。 __proto.createOneLine=function(startWord,lastWords,hasLine,graphic,recList){ var lineY=lastWords.y+lastWords.height; if(hasLine) graphic.drawLine(startWord.x,lineY,lastWords.x+lastWords.width,lineY,this.color,1); var hitRec=HTMLHitRect.create(); hitRec.rec.setTo(startWord.x,lastWords...

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

410. CPU优化方式(TypeScript-2D进阶篇(TS)-性能优化) [ 77%]

...多种做法,而其间差异很有必要知道。 1. 使用getBounds/ getGraphicBounds。 ```typescript var sp=new Laya.Sprite(); sp.graphics.drawRect(0,0,100,100,"#FF0000"); var bounds:Laya.Rectangle=sp.getGraphicBounds(); Laya.stage.addChild(sp); ``` getBounds可以满足多数多数需求,但...

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