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

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

401. 鼠标事件能否在有图形的区域感应,特别是子项坐标为负数时(已经找到问题) [ 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

402. 关于适配有点疑惑 [ 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

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

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

405. 鼠标交互-滑动 [ 77%]

...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_示例 发布时间: 20240930

406. 图片通过drawTexture平铺出现缝隙 [ 77%]

...t: Texture = Laya.loader.getRes("load/0.png");         this.darwSprite.graphics.drawTexture(t,0,0);         this.darwSprite.graphics.drawTexture(t,176,0);         this.darwSprite.graphics.drawTexture(t,176*2,0);   采用这方式在sprite内部绘制了3个一样的png,每一个宽度...

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

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

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

408. 绘制三角形、多边形及根据数据绘制图案(JavaScript-LayaAir基础篇(JS)-矢量图) [ 77%]

...定的路径数据绘制出图案均可使用LayaAir引擎中laya.display.Graphics类的“drawpoly();”方法实现。该方法的详细说明如下图所示: ​ ![blob.png](img/1.png) ​ (图1) ### 一、绘制三角形 下面我们用LayaAir引擎先绘制一个三角形,示例代码...

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

409. 骨骼动画-Spine事件 [ 77%]

...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_示例 发布时间: 20240930

410. 鼠标交互-滑动 [ 77%]

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