【发布时间】:2012-02-24 13:45:57
【问题描述】:
我需要为我的一个项目创建一个游戏。该游戏不是一个图形游戏,但我仍然希望它具有漂亮的外观(也许是 3D 背景外观)。 我想我会使用一种不同的技术,而不仅仅是通过 xml 文件加载背景。我想创建一个具有漂亮纹理背景的表面视图(我想要的是类似于动态墙纸的表面视图)。我知道有rendererscript,但显然它在低于11的api级别上不起作用???我想定位 api 级别 7 或 8。
这是我计划做的事情:
mView = new BasicGLSurfaceView(getApplication());
View inflatedView=View.inflate(this, R.layout.title, null);
View inflatedView2=View.inflate(this, R.layout.buttons, null);
setContentView(mView);
this.getWindow().addContentView(inflatedView,
new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT));
this.getWindow().addContentView(inflatedView2,
new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.MATCH_PARENT));
我想知道哪种方式最好: 使用打开的 GLSurfaceView 或普通的 SurfaceView 和 Canvas。哪个更快,看起来更好? 您能否就实施的最佳解决方案向我提出建议?
谢谢
【问题讨论】:
标签: android opengl-es background surfaceview