大约有 418 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0039 秒)
...关于遍历产生的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
...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
...然能用但是重复代码太多!!! 我想问有没有用一个for循环动态给每个button添加事件的方法? 附件 : --> 2018-08-17 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 1 个回复 Laya_Aaron ...
来源: Laya_社区 发布时间: 20180817
...():void { ....... //这里是销毁地图层的代码 var tLayer:MapLayer; for (i = 0; i < _layerArray.length; i++) { tLayer = _layerArray[i]; tLayer.clearAll(); } ........ }然后在MapLayer的clearAll()里面会去销毁子节点GridSprite /** * @private * 清理当前对象 */ public function ...
来源: Laya_社区 发布时间: 20180503
...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
... { 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
关于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
...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
...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
....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