久久久久久久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(使用線程逐塊處理文件)
主站蜘蛛池模板: 91精品国产91久久久久游泳池 | 国产高清在线精品 | 美日韩精品 | 日韩中文字幕免费在线 | 免费看啪啪网站 | 成人午夜免费在线视频 | 欧美一区二区三区四区在线 | 欧美日韩精品一区二区三区蜜桃 | www免费视频 | 天天视频成人 | 亚欧性视频 | 天天干天天插 | 狠狠爱综合| 91精品国产乱码久久久久久久 | 国产91丝袜在线播放 | 国产精品久久久久久久久动漫 | 国产精品久久久久久久久久久久久久 | 福利影院在线看 | 麻豆国产一区二区三区四区 | www.亚洲一区 | 在线中文字幕亚洲 | 欧美久久精品一级c片 | 91精品久久久久久久久中文字幕 | 99爱在线免费观看 | 免费麻豆视频 | 久久久久成人精品免费播放动漫 | 欧美精品日韩 | 精品国产欧美一区二区三区成人 | 91 久久 | 99精品久久久 | 国产精品久久久久一区二区三区 | 九九天堂网 | 久久久久久成人 | 一区二区高清在线观看 | 99精品一级欧美片免费播放 | 久久久久久国产精品 | 中文字幕免费在线 | 欧美综合一区二区 | 999视频在线播放 | 久草在线中文888 | 一级看片 |