久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

混合 Android 視圖和 GLSurfaceView

Mixing Android Views and GLSurfaceView(混合 Android 視圖和 GLSurfaceView)
本文介紹了混合 Android 視圖和 GLSurfaceView的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我目前正在開發一款游戲,我不想在進行到一半時發現我正在做的事情會導致錯誤/扼殺性能.這就是我正在考慮的設置方式.

I'm currently working on a game and I would hate to get halfway through and find that the what I'm doing causes errors/kills performance. This is how I'm thinking of setting it up.

首先想要一個帶有一個包含 HUD 的 LinearLayout 的 LinearLayout,然后是一個 GLSurfaceView.但是我可能會在某些時候暫停"游戲視圖并切換到包含庫存或裝備等的不同線性布局.

First want to have a LinearLayout with a LinearLayout containing a HUD, and then a GLSurfaceView. However I may at certain points "pause" the game view and switch to a different linear layout containing an inventory or equips, etc.

我認為這種方式最好,因為我可以利用 android 自帶的所有優秀組件,而不是使用 OpenGL 自己制作.但是我擔心混合這兩種視圖可能會出現一些問題.任何見解或建議將不勝感激.謝謝.

I think this way would be best because I can make use of all the great components that android comes with rather than making my own with OpenGL. However I am worried that mixing the two types of view may have some problems. Any insight or suggestions would be greatly appreciated. Thanks.

推薦答案

我一直在使用帶有 GLSurfaceView 作為第一個元素的 FrameLayout.IE.在堆棧的底部,其他視圖/視圖組位于其頂部.我建議只是暫停游戲循環并在其頂部放置一些不透明的視圖以隱藏它,而不是交換視圖或其他任何東西:

I've been using a FrameLayout with the GLSurfaceView as the first element. I.e. at the bottom of the stack, with other views / viewgroups layered over the top of it. I'd recommend just pausing the game-loop and placing some opaque view over the top of it to hide it rather than swapping views in and out or whatever:

<FrameLayout 
    android:id="@+id/graphics_frameLayout1" 
    android:layout_width="fill_parent" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_height="fill_parent">
    <android.opengl.GLSurfaceView 
        android:id="@+id/graphics_glsurfaceview1" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent">
    </android.opengl.GLSurfaceView>
    <LinearLayout 
        android:layout_height="fill_parent" 
        android:id="@+id/inventory" 
        android:gravity="center" 
        android:layout_width="fill_parent" 
        android:orientation="vertical"
        android:visibility="gone">
    </LinearLayout>
    <LinearLayout 
        android:layout_height="fill_parent" 
        android:id="@+id/HUD" 
        android:gravity="center" 
        android:layout_width="fill_parent" 
        android:orientation="vertical">
    </LinearLayout>
</FrameLayout>

這篇關于混合 Android 視圖和 GLSurfaceView的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數據庫)
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 免费的av | 国产a√| 欧美国产日韩在线 | av网站观看 | 亚洲激情另类 | 色婷婷导航 | 国产福利视频在线 | 97在线超碰 | 精品一区二区三区免费毛片 | 成人精品一区二区三区 | 亚洲激情欧美 | 中文字幕丰满人伦在线 | 91国产丝袜在线播放 | 国产高清毛片 | 久久久久久爱 | 国产精品久久网 | 国产三级在线免费观看 | 亚洲精品网站在线观看 | 欧美另类综合 | 免费看色片 | 亚洲在线视频 | 国产91在线播放 | 美国特色黄a大片 | 久久综合热| 久久久成人免费视频 | 中文在线观看视频 | 黄色国产 | 中文字幕国产在线 | 国产成人一区二区三区 | 日日干日日操 | 欧美日韩一区在线 | 欧美日韩一区二区在线 | 亚洲激情综合 | 欧美日本在线 | 国产视频一区二区在线播放 | 欧美国产日韩一区二区 | 国产一级黄色录像 | 免费99精品国产自在在线 | 黄色高潮视频 | 欧美精品乱码视频一二专区 | 三级在线免费观看 |