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

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

21. 关于遍历产生的sprite的点击事件,急,大神帮看哈 [ 93%]

...关于遍历产生的sprite的点击事件,急,大神帮看哈 var sp; for(var i=0;i<5;i++){    sp=new Laya.Sprite();    sp.index=i;    Laya.stage.addChild(sp); } 类似这样遍历出来的sprite 我怎么给每个sprite添加一个点击事件获得对应的sp.index值呢! 2017-02-21 ...

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

22. 网络和格式-XML [ 93%]

...en(xml) { var rootNode = xml.firstChild ; var nodes = rootNode.childNodes; for (var i = 0; i item aitem bsomethis..."; var xmlValue:string = "item aitem bsomethings..."; this.proessXML(xmlValueContainsError); console.log("\n"); this.proessXML(xmlValue); } // 使用xml private proessXML(source:string...

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

23. 怎么给List下的每个item中的button添加事件? [ 92%]

...然能用但是重复代码太多!!!   我想问有没有用一个for循环动态给每个button添加事件的方法?   附件 : --> 2018-08-17 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 1 个回复 Laya_Aaron ...

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

24. TiledMap销毁的问题,TiledMap销毁后屏幕变灰,不能显示 [ 92%]

...():void { ....... //这里是销毁地图层的代码 var tLayer:MapLayer; for (i = 0; i < _layerArray.length; i++) { tLayer = _layerArray[i]; tLayer.clearAll(); } ........ }然后在MapLayer的clearAll()里面会去销毁子节点GridSprite /** * @private * 清理当前对象 */ public function ...

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

25. 性能测试-卡通人物 [ 92%]

...l, Loader.ATLAS); })(); function createCharacters() { characterGroup = []; for(var i = 0; i = 0; --i) { animateCharactor(characterGroup[i]); } } function animateCharactor(charactor) { charactor.x += moveSpeed; charactor.rotation += rotateSpeed; if (charactor.x > Laya.stage.width + extraSpace) { char...

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

26. 其他引擎的Demo-Example_04 [ 92%]

... { Laya.init(w, h, WebGL); createText(); start(); })(); function start() { for (var i = 0; i w) { stars[i].x = stars[i].x - w; } else if (stars[i].x h) { stars[i].y = stars[i].y - h; } else if (stars[i].y = []; private w:number = Browser.width; private h:number = Browser.height; private slideX:numbe...

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

27. 关于Sprite回收 [ 92%]

关于Sprite回收 // 移除item         for(var i = 0; i < this.numChildren; i++) {             console.log(this.numChildren);             var item = this.getChildAt(i);             if(item instanceof Item) {                 item.removeSelf();               ...

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

28. UI-CheckBox [ 92%]

...eate(this, this.onCheckBoxSkinLoaded)); } onCheckBoxSkinLoaded() { let cb; for (let i = 0; i ; constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(800, 600, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOW...

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

29. 2D物理-碰撞事件与传感器 [ 91%]

...nsorCollider.radius = 100; sensorCollider.x = 450; sensorCollider.y = 300; for (let i = 0, len = this.count; i = []; private touching: Array = []; constructor(maincls: typeof Main) { this.Main = maincls; Laya.Config.isAntialias = true; Laya.init(1200, 700, WebGL); Stat.show(); Physics.enable(); Phys...

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

30. SphereCollider和MeshCollider碰撞检测的bug [ 91%]

....ContainmentType.Disjoint*/0){ var positions=meshCollider.mesh._positions; for (var i=0,n=positions.length;i < n;i++){ if (Collision.sphereContainsPoint(this.boundSphere,positions[i])===/*laya.d3.math.ContainmentType.Contains*/1) return true } return false; }else { return false; } break ;   上...

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