GLSurfaceView / SurfaceView重叠 [英] GLSurfaceView/SurfaceView overlap

查看:1866
本文介绍了GLSurfaceView / SurfaceView重叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我问了这个问题前面,但没有得到任何回应,所以我再试一次。

I asked a question about this earlier but received no responses, so I'm trying again.

我需要做一个渲染的2D画面,在摩托罗拉Xoom,安卓3.0一些相关的标签和图形。虽然我需要可以只用一个SurfaceView(Canvas)的,或只是一个GLSurfaceView做什么,我真的想同时使用,因为渲染速度更快的GLSurfaceView,以及标签和图形与SurfaceView更容易。可视化布局,如下图所示。

I need to do a rendered 2D picture with some accompanying labels and graphics on a Motorola Xoom, Android 3.0. Although what I need can be done with just a SurfaceView (Canvas) or just a GLSurfaceView, I would really like to use both because the rendering is faster with the GLSurfaceView, and the labeling and graphics are easier with the SurfaceView. The visual layout is as shown below.

我试图把SurfaceView之上,宣布其在GLSurfaceView后的布局XML。该SurfaceView是透明的(除了在这里我明确地画的东西),以便GLSurfaceView依稀可见。

I tried to put the SurfaceView on top by declaring it in the layout XML after the GLSurfaceView. The SurfaceView is transparent (except for where I explicitly draw stuff) so that the GLSurfaceView can still be seen.

此方法曾pretty的还有一个巨大的例外。凡是我借鉴SurfaceView是在GLSurfaceView区域不显示在所有。为了验证这一点,我画了一些文字,是正确的边界(有的在共享区域,有的只是在SurfaceView区域),并且它在GLSurfaceView边界剁掉。我已经使用了bringToFront的方法来解决这个问题试过了,但效果不好。

This approach has worked pretty well with one huge exception. Anything that I draw on the SurfaceView that is in the GLSurfaceView region does not show up at all. To verify this I drew some text that was right on the boundary (some in the shared region, some just in the SurfaceView region), and it was chopped off at the GLSurfaceView boundary. I have tried using the "bringToFront" method to fix this, but it hasn't worked.

任何人都可以给我为什么一些想法是不工作或我能做些什么呢?是不是该GLSurfaceView在前面,或者是,GLSurfaceView直接写入显存,所以不要紧,如果事情是在它的前面?

Can anyone give me some ideas on why this isn't working or what I can do about it? Is it that the GLSurfaceView is in front, or is that the GLSurfaceView writes directly to the video memory, so it doesn't matter if something is in front of it?

推荐答案

SurfaceViews工作将无法做你想要的方式。你将不得不使GLSurfaceView在你的文字。

The way SurfaceViews work will make it impossible to do what you want. You will have to render your text inside the GLSurfaceView.

这篇关于GLSurfaceView / SurfaceView重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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