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

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

31. Laya.Sprite loadImage 参数问题 [ 82%]

Laya.Sprite loadImage 参数问题 第一天学习laya,遇见个问题。api上对loadimage的描述是:   loadImage(url:String, x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0, complete:Handler = null) 官方文档也是这么用的:http://ldc.layabox.com/doc/?nav=zh-ts-1-3-...

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

32. 滤镜-模糊滤镜 [ 82%]

...teApe)); } private createApe(): void { var ape: Sprite = new Sprite(); ape.loadImage(this.apePath); ape.x = (Laya.stage.width - ape.width) / 2; ape.y = (Laya.stage.height - ape.height) / 2; Laya.stage.addChild(ape); this.applayFilter(ape); } private applayFilter(ape: Sprite): void { var blurFilter: ...

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

33. Sprite-旋转缩放 [ 82%]

...232628"; createApe(); })(); function createApe() { ape = new Sprite(); ape.loadImage("../../res/apes/monkey2.png"); Laya.stage.addChild(ape); ape.pivot(55, 72); ape.x = Laya.stage.width / 2; ape.y = Laya.stage.height / 2; Laya.timer.frameLoop(1, this, animate); } function animate(e) { ape.rotation +...

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

34. RopeJoint代码动态创建 无法设置otherbody等属性 [ 82%]

...r img:Sprite = new Sprite(); //加载显示图片,坐标位于100,50 img.loadImage("res/layabox.png"); img.x=(Laya.stage.width-256)/2; //添加到舞台 Laya.stage.addChild(img); var img2:Sprite = new Sprite(); //加载显示图片,坐标位于100,50 img2.loadImage("res/layabox.png"); img2.x=(La...

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

35. 设置滤镜(ActionScript-LayaAir基础篇(AS3)-位图) [ 81%]

...} private function createApe():Sprite { var ape:Sprite = new Sprite(); ape.loadImage(ApePath); Laya.stage.addChild(ape); return ape; } } } ``` 在上面的代码中,我们创建了一个原始位图、一个红色滤镜效果位图、一个灰色滤镜效果位图。运行效果如图1所示: ![...

来源: Laya2.0_文档 发布时间: 20210715

36. sprite.loadImage加载图片怎么设置要显示的x,y坐标和宽高? [ 81%]

sprite.loadImage加载图片怎么设置要显示的x,y坐标和宽高? 代码: import TiledMap = Laya.TiledMap; class GameMain{ private tMap:TiledMap; constructor() { Laya.init(935, 224, Laya.WebGL); this.tMap = new TiledMap(); var viewRect: Laya.Rectangle = new Laya.Rectangle(0, 0, Laya.stage...

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

37. 【laya2.0】加载并且显示图片,并且让该图片居于舞台中央,怎么写? [ 81%]

...同来自: var logo = new Laya.Sprite(); Laya.stage.addChild(logo); logo.loadImage("res/atlas/test.png", Laya.Handler.create(this, function(){ console.log("complete!!"); logo.x= Laya.stage.width/2-logo.width/2; logo.y= Laya.stage.height/2-logo.height/2; //logo.pos(Laya.stage.width/2-logo.width/2,Lay...

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

38. 【紧急】laya2.0的loadImage方法为什么不触发complete? [ 81%]

【紧急】laya2.0的loadImage方法为什么不触发complete? var logo = new Sprite(); Laya.stage.addChild(logo); logo.loadImage("img/load_logo.png", 0, 0, 0, 0, Handler.create(this, function(){ trace("complete!!"); })); 我在laya1.0这么写,触发complete没毛病,为什么到了2.0这...

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

39. 【官方文档不负责任】loadImage方法改了,官方2.0文档还是旧的写法!! [ 81%]

【官方文档不负责任】loadImage方法改了,官方2.0文档还是旧的写法!! https://ldc2.layabox.com/doc/?nav=zh-as-1-3-0 我特地从首页点击“2.0文档”,结果还是没有看到2.0he和1.0的区分。 loadImage这个方法在2.0不是去掉了x/y/width/height吗,2.0...

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

40. 关于闭包的问题 [ 81%]

...r z = 0; z < letterList.length; z++){ var letter = new Sprite(); letter.loadImage("../imgs/linkup/" + letterList[z] + ".png", (bg.width / letterList.length) * z, 0, bg.width / letterList.length, bg.height / 2); Laya.stage.addChild(letter); letter.on("click", this, (function(para){ console.log("z:...

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