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

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

41. 能通过不规则热区来实现物体的碰撞检测吗? [ 84%]

...ayabox.com/question/1261 var sprite:Sprite = new Sprite(); sprite.graphics.drawRect(100,100,100,100,"#ff9900"); var hitarea:HitArea = new HitArea(); var graphics:Graphics = new Graphics(); graphics.drawRect(100,100,100,100,"#ff9900"); hitarea.hit = graphics; sprite.hitArea = hitarea; 2017-07-01 0 1 ...

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

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

...常显示。 let bigMask:Laya.Sprite = new Laya.Sprite(); bigMask.graphics.drawRect(0, 0, 300, 200, "#ffffff"); this.mask = bigMask; // let 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)....

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

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

...常显示。 let bigMask:Laya.Sprite = new Laya.Sprite(); bigMask.graphics.drawRect(0, 0, 300, 200, "#ffffff"); this.mask = bigMask; // let 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)....

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

44. 屏幕适配-缩放-No Border [ 83%]

...{ const Sprite = Laya.Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } updateRectPos() { this.rect.x = Laya.stage.width / 2; this.rect.y = Laya.stage.height / 2; } } new SmartScale_Scale_NOBORDER();mo...

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

45. 屏幕适配-缩放-No Scale [ 83%]

...{ const Sprite = Laya.Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } updateRectPos() { this.rect.x = Laya.stage.width / 2; this.rect.y = Laya.stage.height / 2; } } new SmartScale_Scale_NOSCALE();mod...

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

46. 屏幕适配-缩放-Extract Fit [ 82%]

...{ const Sprite = Laya.Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } updateRectPos() { this.rect.x = Laya.stage.width / 2; this.rect.y = Laya.stage.height / 2; } } new SmartScale_Scale_EXTRACT_FIT()...

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

47. 屏幕适配-缩放-Show All [ 82%]

...{ const Sprite = Laya.Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } updateRectPos() { this.rect.x = Laya.stage.width / 2; this.rect.y = Laya.stage.height / 2; } } new SmartScale_Scale_SHOW_ALL();mo...

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

48. 怎么检测两个不规则物体之间的碰撞 [ 82%]

...自: 可以参考下: var sprite:Sprite = new Sprite(); sprite.graphics.drawRect(100,100,100,100,"#ff9900"); var hitarea:HitArea = new HitArea(); var graphics:Graphics = new Graphics(); graphics.drawRect(100,100,100,100,"#ff9900"); hitarea.hit = graphics; sprite.hitArea = hitarea;其中graphics可...

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

49. 鼠标事件能否在有图形的区域感应,特别是子项坐标为负数时(已经找到问题) [ 82%]

...vate 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,onMouseClick); t...

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

50. 关于适配有点疑惑 [ 82%]

...); })(); 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.drawRect(Lay...

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