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

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

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

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

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

242. 骨骼动画-Spine事件 [ 76%]

...e.addChild(mLabelSprite); mLabelSprite.pos(mStartX, mStartY); mLabelSprite.graphics.fillText(tEventData.name, 0, 0, "20px Arial", "#ff0000", "center"); Tween.to(mLabelSprite, { y: mStartY - 200 }, 1000, null, Handler.create(this, this.playEnd)) } playEnd() { mLabelSprite.removeSelf(); } } new Skelet...

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

243. hitTestPrior点击穿透 [ 76%]

...0,600,WebGL); Laya.stage.bgColor="#EEFFCC"; var sp:Sprite=new Sprite(); sp.graphics.drawRect(0,0,300,300,"#FFFF00"); sp.size(100,100); sp.on(Event.CLICK,this,onClickSp); Laya.stage.addChild(sp); var spchild:Sprite=new Sprite(); spchild.graphics.drawRect(0,0,200,200,"#FF0000"); spchild.size(200,200);...

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

244. 按钮扩大热区的问题 [ 76%]

...区的问题 根据你们提示的方法给按钮增加热区   var tempgraphics:Laya.Graphics= new Laya.Graphics(); tempgraphics.drawRect(0,0,50,50,"FFFFFF"; this.rootSceneView.avatorBtn.hitArea = tempgraphics   首先绘制的时候必须带上颜色 才能绘制  然后会崩溃   附件 : --...

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

245. 鼠标交互-滑动 [ 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_示例 发布时间: 20251209

246. 设置遮罩(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

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

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

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

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

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

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

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

250. 【简单跑酷--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