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

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

101. CPU优化方式(ActionScript-2D进阶篇(AS3)-性能优化) [ 86%]

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

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

102. 设置遮罩(TypeScript-LayaAir基础篇(TS)-位图) [ 86%]

...并添加到舞台 Laya.loader.load(this.Res,Laya.Handler.create(this,this.graphicsImg)); } private graphicsImg():void{ this.img = new Laya.Sprite(); //获取图片资源,绘制到画布 this.img.graphics.drawTexture(Laya.loader.getRes(this.Res),150,50); //添加到舞台 Laya.stage.addChild(this....

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

103. 关于removeChildren、 destroy和destroyChildren的疑惑 [ 86%]

...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

104. 分享一个Graphics画圆角矩形的封装 [ 86%]

分享一个Graphics画圆角矩形的封装 圆角矩形实践中用得频繁,做了一个封装分享出来,TS版本的,分2步:   1、在项目的libs目录中新建一个d.ts,写入画圆角矩形的函数声明 declare namespace laya.display {     interface Graphics {      ...

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

105. laya中的截屏在WebGL下为什么无效呢? [ 86%]

...照特效 this._shapeSnapEffect = new egret.Shape; this._shapeSnapEffect.graphics.beginFill( 0xFFFFFF ); this._shapeSnapEffect.graphics.drawRect( 0, 0, L.W_CLIP, L.H_CLIP ); this._shapeSnapEffect.graphics.endFill(); this._shapeSnapEffect.cacheAsBitmap = true; this._shapeSnapEffect.x = this._bmpSnap....

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

106. Graphics如何设置fillStyle和strokeStyle不同透明度 [ 86%]

Graphics如何设置fillStyle和strokeStyle不同透明度 请问如果实现一个填充半透明而边框不透明的圆角矩形的绘制呢? 2018-04-16 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 3 个回复 w111436...

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

107. 如何使用graphics绘画虚线 [ 85%]

如何使用graphics绘画虚线 如何使用graphics绘画虚线?类似 CanvasRenderingContext2D.setLineDash() 那种。如没有实现,能否把这个方法加上? 2017-04-23 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 ...

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

108. 鼠标交互-自定义事件 [ 85%]

... Sprite = Laya.Sprite, Event = Laya.Event; this.sp = new Sprite(); this.sp.graphics.drawRect(0, 0, 200, 200, "#D2691E"); this.sp.pivot(100, 100); this.sp.x = Laya.stage.width / 2; this.sp.y = Laya.stage.height / 2; this.sp.size(200, 200); Laya.stage.addChild(this.sp); this.sp.on(ROTATE, this, this.o...

来源: Laya2.0_示例 发布时间: 20251209

109. layaAir真的没办法做涂鸦板? [ 85%]

layaAir真的没办法做涂鸦板? 我用sp.graphics.drawLines方法做了个鼠标画线,确实是连续画的时间长了,就会很卡,在平板上尤其明显,画两三条线之后就不行了,没办法解决吗?用JS原生的画线方法怎么能加载我的内容上呢,我是...

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

110. iphoneX环境下新手引导的抠图透明区域为黑色,其它机型都是正常的。 [ 85%]

... maskArea: Laya.Sprite = new Laya.Sprite(); maskArea.alpha = 0.5; maskArea.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000"); maskArea.name = "maskArea"; this.guideContainer.addChild(maskArea); this.interactionArea = new Laya.Sprite(); this.interactionArea.blendMode = "destinat...

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