在GLES2,AndEngine垂直AutoParallaxBackgroundAndEngine、AutoParallaxBackground

由网友(水煮美人鱼)分享简介:我如何在andengine移动一个AutoParallaxBackground垂直?这是这样一个简单的问题,但我不能找到一个解决办法吧! How do I move an AutoParallaxBackground vertically in andengine? This is such a simple pro...

我如何在andengine移动一个AutoParallaxBackground垂直?这是这样一个简单的问题,但我不能找到一个解决办法吧!

How do I move an AutoParallaxBackground vertically in andengine? This is such a simple problem, but I can't find a solution to it!

我用GLES2,我用c表示code中的$ C $的附带AndEngine http://$c$c.google.com/p/andengineexamples/source/browse/src/org/anddev/andengine/examples/AutoParallaxBackgroundExample.java.

I use GLES2, and I use the code that code in the example that comes with AndEngine http://code.google.com/p/andengineexamples/source/browse/src/org/anddev/andengine/examples/AutoParallaxBackgroundExample.java.

的事情是,你不能改变或添加任何地方垂直速度,因为没有为AutoParallaxBackground创建的类 - 它只是在你可以改变主类中的参数

The thing is that you can't change or add vertical speed anywhere since there is no class created for the AutoParallaxBackground - it is only the parameters in the main class that you can change.

推荐答案

我相信,有没有简单的方法来做到这一点。你将不得不进行修改以满足您的需求,这应该很容易。

I believe there is no easy way to do that. You will have to modify it to suit your needs, which should be easy enough.

编辑:由于某种原因,这个问题突然出现在我的饲料了,所以我看着这件事一点。我相信,以使这项工作的关键是要改变 ParallaxEntity 的方法的OnDraw 。有一个叫OpenGL的的的glTranslatef 方法只里面有三个参数(X,Y,Z)填写之一,因此显而易见的解决办法是提供第二个参数为好。

For some reason, this question popped up in my feed again, so I looked into the matter a bit more. I believe the key to make this work is to change the method onDraw of ParallaxEntity. There is a call to OpenGL's glTranslatef method which has only one of the three parameters (x, y, z) filled in, so the obvious solution would be to provide the second parameter as well.

阅读全文

相关推荐

最新文章