大约有 1,363 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0077 秒)
Laya_社区(1071) Laya3.0_api(81) Laya2.0_api(57) laya_api(53) Laya2.0_文档(50) Laya3.0_文档(38) Laya2.0_示例(7) Laya_示例(6)
...后用event.targe指向。layaair折腾半天,搞不明白image组件,sprite.loadImage,Laya.loader.load如果用for循环操作,响应事件中用什么方法指向事件的发起对象?原来用e.target和e.data。现在事件发起者和加载的数据怎么得到呢?(不用循环可...
来源: Laya_社区 发布时间: 20161023
... 我试着用代码实现物理效果class CollisionBoll extends Laya.Sprite { private _boll1:Laya.Sprite; constructor() { super(); //物理模块 this._boll1 = new Laya.Sprite(); this.addChild(this._boll1); this._boll1.x = 20; this._boll1.loadImage('comp/btn_close.png'); let box:laya.physics.Box...
来源: Laya_社区 发布时间: 20190428
...一个类。代码如下:module npc { export class BaseNPC extends Laya.Sprite { constructor() { super(); this.graphics.drawCircle(0, 0, 10, "#ff0000"); } } } 然后在我的主文件中import,并new出来。代码如下:import BaseNPC = npc.BaseNPC; var npcc:BaseNPC = new BaseNPC(); 只要...
来源: Laya_社区 发布时间: 20180205
...们介绍代码是如何使用的 三、代码中创建与使用 PixelLineSprite3D 是 LayaAir引擎提供的像素线3D精灵类,我们看看这个类最重要的方法 3.1 构造方法 从下面的代码中可以看到,当初始化一个PixelLineSprite3D 的构造方法时,代码已经帮我...
来源: Laya3.0_文档 发布时间: 20251010
Sprite graphics的显示比例问题 function createCharacter(skin) { var character = new Laya.Sprite(); character.loadImage(skin, 0, 0, 200, 200, Laya.Handler.create(this, function () {console.log('KO!~'); })); character.graphics.drawLine(0, 200, 200, 0, "#ff0000", 1); character.graphics.drawLine(...
来源: Laya_社区 发布时间: 20170828
...xWidth, ConstValue.boxHeight); var box = this.parent.addChild(new Laya.MeshSprite3D(mesh)); box.transform.rotate(new Laya.Vector3(0, 45, 0), false, false); box.transform.position = new Laya.Vector3(ConstValue.boxOutScreen,ConstValue.boxHeight/2,0); var material = new Laya.StandardMaterial(); materia...
来源: Laya_社区 发布时间: 20180113
...fined in laya/display/Node.ts:56 _graphics _graphics: AutoBitmap Overrides Sprite._graphics Defined in laya/ui/Button.ts:212 _ownGraphics _ownGraphics: boolean = false Implementation of ISelect._ownGraphics Inherited from Text._ownGraphics Defined in laya/display/Sprite.ts:252 _scene _scene: Node Im...
来源: Laya3.0_api 发布时间: 20231115
...rayCast(ray2, rayCastHit2, 300); if(rayCastHit2.sprite3D) { //这里取碰撞点的y值给角色重新赋值 var currPosition:Vector3 = new Vector3(_position.x, rayCastHit2.position.y, _position.z); roleModel.transform.position = currP...
来源: Laya_社区 发布时间: 20170828
...可能会被裁剪掉,设置方式如下:package { import laya.display.Sprite; import laya.display.Stage; import laya.map.TiledMap; import laya.maths.Rectangle; import laya.utils.Handler; public class LayaAirDemo { private var tiledMap:TiledMap; public function LayaAirDemo() { // 不支持WebGL...
来源: Laya_社区 发布时间: 20170419
...en.to 执行失败 //使精灵走到鼠标位置 function walkToMousePos(sprite){ console.log(Laya.stage.mouseX) ; console.log(Laya.stage.mouseY) ; console.log(sprite.x) ; console.log(sprite.y) ; var hDir = Laya.stage.mouseX>sprite.x? "right" : "left" ; var vDir = Laya.stage.mouseY>sprite.y?...
来源: Laya_社区 发布时间: 20180331