安卓:AndEngine - AnimatedSprite纹理尺寸过大? [英] Android: AndEngine - AnimatedSprite texture size too large?

查看:166
本文介绍了安卓:AndEngine - AnimatedSprite纹理尺寸过大?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

抱歉,如果这个问题以前也有人问,但我找不到对它的引用,试图开始使用andEngine,我试图用图片3360x720,因为它有7列平铺。我试过这个方法:

sorry if this issue's been asked before but I couldn't find a reference to it, trying to start using andEngine and I'm trying to use an image 3360x720, because it's tiled with 7 columns. I've tried this method:

// Initialize the background
this.mBackgroundTexture = new Texture(4096, 1024, TextureOptions.BILINEAR);
this.mEngine.getTextureManager().loadTextures(this.mBackgroundTexture);
this.mBackgroundRegion = TextureRegionFactory.createTiledFromAsset(this.mBackgroundTexture, this, "back_anim_tiled.png", 0, 0, 7, 1);// 3360x720
this.mBackground = new AnimatedSprite(0, 0, 480, 720, this.mBackgroundRegion);

现在我得到的是一个白色的屏幕,当我动画,然后将其安装到现场?是纹理太大了此操作,如果是这样,我应该为一个简单的小动画做的,如出现一秒钟闪电?我想这是一个实际的animatedSprite而不是我居然手动设置背景图片..任何帮助将是AP preaciated,谢谢

Now all I get is a white screen when I animate, and attach it to the scene? Is the texture simply too big for this operation, and if so, what should I do for a simple small animation such as a lightning bolt appearing for a second? I would like this to be an actual animatedSprite rather than me actually manually setting the background image.. any help would be appreaciated, thank you

[新信息]
我几乎可以肯定它是与每一个手机可以处理的大小。我已经通过调整我的形象1024x720,2048x720,并再次测试4096x720这一点。一直在我的精灵大小一样的480x720(相机尺寸)和它的工作只是罚款为任意数量列前两个,但4096px只显示白色画面。哦,好吧,如果有人认为解决的办法请让我知道,因为现在我可能就手动手动调整我的动画SRC的形象。

[new information] I'm almost positive it has something to do with the size that each phone can handle. I've tested this out by resizing my image to 1024x720, 2048x720, and again to 4096x720. Kept my sprite size the same as 480x720 (camera size) and it worked just fine for any number of columns for the first two, but the 4096px simply shows the white screen. Oh well, if someone finds a way around this please let me know, as for now I'll probably just manually adjust my "animation" src image manually.

我自从发现,当你得到的纹理1024×1024以上运行的不是它显示的风险,假设每部手机与此不同。所以不是我只是放慢帧率一堆,用较小的图像平铺从。

I've since found that when your texture gets above 1024x1024 you run the risk of it not being displayed, assuming each phone is different with this. So instead I'm simply slowing down the framerate a bunch and using a smaller image to tile from.

推荐答案

我也经历了类似的问题,那里似乎是非常大纹理的大小随机限制。我使用的背景为我的游戏,在尺寸为1024×1024纹理和它似乎是,如果我想有4个或更多显示的最后添加只会显示为白色。

I have experienced a similar issue where there seems to be a random limit on the size of very large textures. I use backgrounds for my game with Textures that are 1024 x 1024 in size and it seemed that if I tried to have 4 or more displayed the last to be added would simply show up as white.

对不起,我不能提供任何实际的帮助,但绝对不强调它,因为你和我是不是第一次有这样的问题,我认为这是那些萨科将在Andengine被烫出来的事情之一。

Sorry I can't offer any actual help, but definitely don't stress about it because you and I are not the first to have this problem and I think it's one of those things that Nicolas will be ironing out in Andengine.

这篇关于安卓:AndEngine - AnimatedSprite纹理尺寸过大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆