大约有 316 项符合查询结果, 库内数据总量为 30,723 项。 (搜索耗时: 0.0040 秒)
Laya_社区(98) Laya3.0_api(64) Laya2.0_api(59) laya_api(55) Laya2.0_示例(13) Laya_示例(12) Laya2.0_文档(11) Laya3.0_文档(4)
...} private function createApe():Sprite { var ape:Sprite = new Sprite(); ape.loadImage(ApePath); Laya.stage.addChild(ape); return ape; } } } ``` 在上面的代码中,我们创建了一个原始位图、一个红色滤镜效果位图、一个灰色滤镜效果位图。运行效果如图1所示: ![...
来源: Laya2.0_文档 发布时间: 20210715
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
...同来自: 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
【紧急】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
【官方文档不负责任】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
...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
... })(); function showApe() { // 方法1:使用loadImage var ape = new Sprite(); Laya.stage.addChild(ape); ape.loadImage("../../res/apes/monkey3.png"); // 方法2:使用drawTexture Laya.loader.load("../../res...
来源: Laya_社区 发布时间: 20171201
...yFilter(); } private createApe(): void { this.ape = new Sprite(); this.ape.loadImage(this.apePath); var texture: Texture = Laya.loader.getRes(this.apePath); this.ape.x = (Laya.stage.width - texture.width) / 2; this.ape.y = (Laya.stage.height - texture.height) / 2; Laya.stage.addChild(this.ape); } pr...
来源: Laya2.0_示例 发布时间: 20240929
...的显示是游戏开发基础,本篇从API到示例分别介绍Sprite.loadImage与Graphics.drawTexture两种显示图片的方法。 ## 1、用loadImage方法显示与切换图片 ### 1.1 loadImage API概述 在API文档中搜索laya.display.Sprite,可以找到loadImage()方法,如图1所示...
来源: Laya2.0_文档 发布时间: 20210715
...于创建Sprite获取大小 发现个奇怪的问题,new Laya.Sprite().loadImage() 创建的对象大小不是图像大小,然后用getBounds获取也拿不到真实的大小? 这个建议官方改下接口,理论上width和height用来检测碰撞,那你看到的就应该是碰撞...
来源: Laya_社区 发布时间: 20180530