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

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

231. RopeJoint代码动态创建 无法设置otherbody等属性 [ 78%]

...属性 var img:Sprite = new Sprite(); //加载显示图片,坐标位于100,50 img.loadImage("res/layabox.png"); img.x=(Laya.stage.width-256)/2; //添加到舞台 Laya.stage.addChild(img); var img2:Sprite = new Sprite(); //加载显示图片,坐标位于100,50 img2.loadImage("res/layabox.png"); i...

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

232. graphics 问题 [ 78%]

...ave(); var matrix:Matrix=new Matrix(); matrix.rotate(45); matrix.translate(100,100); sp.graphics.transform(matrix); sp.graphics.drawRect(0,0,200,100,"#FF0000"); sp.graphics.restore(); Laya.stage.addChild(sp);我测试没有问题,可以把你详细的代码发下,我们看下! 2017-06-09 0 0 ...

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

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

...Bounds。 ```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可以满足多数多数需求,但由于其需要计算边界,不适合频繁调用。 1. 设置容器的autoSize...

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

234. scrollrect的bug? [ 78%]

...ics.drawRect(0,0,200,200,'#ff0000') containr.size(200,200); containr.pivot(100,100); containr.x = 200 containr.y = 200 senceLayer.addChild(containr); var rect = new Rectangle(0,0,200,200); containr.scrollRect = rect; var itemContainr = new Sprite(); itemContainr.size(156,200); containr.addChild(item...

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

235. 按钮点击的位置发生偏移 [ 78%]

按钮点击的位置发生偏移 <div style="padding: 50px 0px;height:100vh"> <div style="position: relative"> <div id="mylayaCanvas" ></div> </div> </div>如代码所示 指定layacanvas外包两层div 样式如代码这样设置后发生点击的范围跟实...

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

236. [LayaAir 2.0] 如何用代码为Spirte添加2d物理特性 [ 78%]

...oid { let panel:Laya.Sprite = new Laya.Sprite(); panel.graphics.drawRect(0,100,100,20,0xffffff); this.addChild(panel); let box:laya.physics.BoxCollider = panel.addComponent(laya.physics.BoxCollider); box.height = 20; box.width = 100; let rigid:Laya.RigidBody = panel.addComponent(Laya.RigidBody); rig...

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

237. 怎么打开第二个工程 [ 78%]

..."absolute";//设置布局定位。这个不能少。 iframe.style.zIndex = 100;//设置层级 iframe.style.left ="100px"; iframe.style.top ="100px"; iframe.src = "http://ask.layabox.com/"; Browser.document.body.appendChild(iframe); } } } 2018-02-26 0 1 分享 微博 QZONE 微信 Laya_Aaron 赞同来...

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

238. layanative安卓端需要怎么添加ttf字体,需要增加两种字体? [ 78%]

...c class TestTTFLoader  {   public function TestTTFLoader()  { Laya.init(1000, 900);   Laya.loader.load("res/remember.ttf",new Handler(this,test)); }   private function test():void { var text:Text; text = new Text(); text.fontSize = 30; text.color = "#ff0000"; text.text = "你好"; text.pos(100,...

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

239. 在一个矩形之上画另一个矩形,只显示一个矩形 [ 78%]

...this.chuanBox.x+this.chuanBox.width/2,this.chuanBox.y+this.chuanBox.height-100, this.chuanBox.width/2,100); //世嘉SAGE区 Laya.stage.graphics.drawRect( this.sageBox.x, this.sageBox.y, this.sageBox.width, this.sageBox.height, null, "#FFFFFF", 2); 2018-10-26 添加评论 免费帖 --> 分享 微博 ...

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

240. 被遮罩的显示对象的子显示对象再添加遮罩,则子显示对象显示不正确 [ 77%]

...t imgMask:Laya.Sprite = new Laya.Sprite(); imgMask.graphics.drawRect(0, 0, 100, 300, "#ffffff"); this.img.mask = imgMask; Laya.Tween.to(this.img, {x:100}, 10000).update = Laya.Handler.create(this, this.updateMsk, null, false); } private updateMsk():void { this.img.mask.graphics.clear(true); this.img...

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