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

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

241. 鼠标交互-滑动 [ 75%]

...Event; const w = 50; const h = 30; this.button = new Sprite(); this.button.graphics.drawRect(0, 0, w, h, "#FF7F50"); this.button.pivot(w / 2, h / 2); //设置宽高(要接收鼠标事件必须设置宽高,否则不会被命中) this.button.size(w, h); this.button.x = (Laya.stage.width - TrackL...

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

242. 设置遮罩(JavaScript-LayaAir基础篇(JS)-位图) [ 75%]

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

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

243. drawPie的问题 [ 75%]

...决了。 原先这样写的,网页上可以,native下是反的。 spt.graphics.drawPie(spt.width / 2, spt.height / 2, spt.width / 2, angle - 90, -90, '#000000'); 现在改成了 spt.graphics.drawPie(spt.width / 2, spt.height / 2, spt.width / 2, angle - 90, -90+360, '#000000'); 2017-08-21 0 1 ...

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

244. 关于序列帧动画的疑问 [ 75%]

...帧动画这里看了下源码实现,需要每帧动画都设置不同的graphics,每个graphics里保存了每帧图片贴图,这里为什么不是公用大贴图,修改渲染uv来实现啊? 公用贴图不是在最终渲染的时候 好合并渲染批次吗? 2017-06-29 添加评论 免...

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

245. 点击区域问题 [ 75%]

...算了,偏复杂。 另一个是sprite.mouseThrough = true;加上sprite.graphics.drawRect。但是遇到个问题是sprite.graphics多了好像我的小米2s会掉帧(十几个150*100的矩形就掉到55以下)。 那么问题来了,有什么简单的确实可行的方案能让负坐标能...

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

246. Sprite-根据数据绘制路径 [ 75%]

...30); path.push(-55, 32); path.push(-137, -30); path.push(-33, -33); canvas.graphics.drawPoly(Laya.stage.width / 2, Laya.stage.height / 2, path, "#FF7F50"); } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Browser = Laya.Browser; import WebGL = Laya.WebGL; export cl...

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

247. 【简单跑酷--JS版】---Lv.6 终篇 [ 75%]

...prite(); this.bar = new Sprite(); this.bar.x = 15; this.bar.y = 2; this.bg.graphics.drawTexture(texture1, 0, 0, 180, 21); this.bar.graphics.drawTexture(texture2, 0, 0, 155, 12); this.addChild(this.bg); this.addChild(this.bar); } /** * 修改当前状态 */ _proto.changeValue = function(value){ this....

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

248. 滤镜问题,有复现demo [ 75%]

...tn.fitlers = null,这时舞台绘画的消失了???? */ Laya.stage.graphics.drawRect(200, 200, Laya.stage.width / 2, Laya.stage.height / 2, "#ffff00"); var btn:Sprite = new Sprite(); btn.size(200, 100); btn.graphics.drawRect(0, 0, btn.width, btn.height, "#ff00ff"); Laya.stage.addChild(btn); ...

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

249. Sprite-根据数据绘制路径 [ 75%]

...30); path.push(-55, 32); path.push(-137, -30); path.push(-33, -33); canvas.graphics.drawPoly(Laya.stage.width / 2, Laya.stage.height / 2, path, "#FF7F50"); } } new Sprite_DrawPath();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Browser = Laya.Browser; import WebGL = La...

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

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

...并添加到舞台 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