大约有 29 项符合查询结果, 库内数据总量为 30,778 项。 (搜索耗时: 0.0027 秒)
...e.graphics.endFill(); addChild(sprite); sprite.addEventListener(MouseEvent.CLICK,onClick); function onClick(evt:MouseEvent):void { trace("------aaa---------"); } ``` **LayaAir引擎中正确的用法示例:** 实现方法一: ```java var sprite:Sprite = new Sprite(); sprite.graphics.drawRect(100...
来源: Laya2.0_文档 发布时间: 20191206
...e.graphics.endFill(); addChild(sprite); sprite.addEventListener(MouseEvent.CLICK,onClick); function onClick(evt:MouseEvent):void { trace("------aaa---------"); } ``` **LayaAir引擎中正确的用法示例:** 实现方法一: ```java var sprite:Sprite = new Sprite(); sprite.graphics.drawRect(100...
来源: Laya2.0_文档 发布时间: 20210714
...图片区域的点击事件,触发后执行switchImg切换图片 img.on("click",this,switchImg); //将图片添加到舞台 Laya.stage.addChild(img); } private function switchImg(e:*=null):void { //清空图片 img.graphics.clear(); //获得要切换的图片资源路径 var imgUrl:String = (flag ...
来源: Laya2.0_文档 发布时间: 20210715
...... //切换图层按钮事件监听 this.changeActionButton.on(Laya.Event.CLICK, this, function():void { this.camera.removeAllLayers(); this.layerIndex ++; this.camera.addLayer(this.layerIndex%4 +1); this.camera.addLayer(5); }); ``` ![](img/1.gif)(图1)
来源: Laya2.0_文档 发布时间: 20210715
...... //切换图层按钮事件监听 this.changeActionButton.on(Laya.Event.CLICK, this, function():void { this.camera.removeAllLayers(); this.layerIndex ++; this.camera.addLayer(this.layerIndex%4 +1); this.camera.addLayer(5); }); ``` ![](img/1.gif)(图1)
来源: Laya2.0_文档 发布时间: 20210715
...r = 4; ...... //切换图层按钮事件监听 changeActionButton.on(Event.CLICK, this, function():void { camera.removeAllLayers(); layerIndex ++; camera.addLayer(layerIndex%4 +1); camera.addLayer(5); }); ``` ![](img/1.gif)(图1)
来源: Laya2.0_文档 发布时间: 20210715
...55, 72); ape.pos(200, 200); // 显示默认纹理 switchTexture(); ape.on("click", this, switchTexture); } function switchTexture() { var textureUrl = (flag = !flag) ? texture1 : texture2; // 更换纹理 ape.graphics.clear(); ape.loadImage(textureUrl); var texture = Laya.loader.getRes(textureUrl); ...
来源: Laya2.0_文档 发布时间: 20210715
...or3(0, 1, 0); ``` ```typescript //点击事件 changeActionButton.on(Event.CLICK, this, function():void{ index++; if (index % 3 === 1 ){ //摄像机捕捉模型目标 camera.transform.lookAt(box.transform.position, _up); } else if (index % 3 === 2){ //摄像机捕捉模型目标 camera.transform.loo...
来源: Laya2.0_文档 发布时间: 20210714
...0); ``` ```typescript //点击事件 this.changeActionButton.on(Laya.Event.CLICK, this, function(){ this.index++; if (this.index % 3 === 1 ){ //摄像机捕捉模型目标 this.camera.transform.lookAt(this.box.transform.position, this._up); } else if (this.index % 3 === 2){ //摄像机捕捉模型...
来源: Laya2.0_文档 发布时间: 20210715
...0); ``` ```typescript //点击事件 this.changeActionButton.on(Laya.Event.CLICK, this, function(){ this.index++; if (this.index % 3 === 1 ){ //摄像机捕捉模型目标 this.camera.transform.lookAt(this.box.transform.position, this._up); } else if (this.index % 3 === 2){ //摄像机捕捉模型...
来源: Laya2.0_文档 发布时间: 20210715