在GLES2,AndEngine垂直AutoParallaxBackground [英] AutoParallaxBackground vertically in GLES2, AndEngine

查看:117
本文介绍了在GLES2,AndEngine垂直AutoParallaxBackground的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何在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 <一个例子href="http://$c$c.google.com/p/andengineexamples/source/browse/src/org/anddev/andengine/examples/AutoParallaxBackgroundExample.java" rel="nofollow">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.

这篇关于在GLES2,AndEngine垂直AutoParallaxBackground的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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