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

混合 Android 視圖和 GLSurfaceView

Mixing Android Views and GLSurfaceView(混合 Android 視圖和 GLSurfaceView)
本文介紹了混合 Android 視圖和 GLSurfaceView的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我目前正在開(kāi)發(fā)一款游戲,我不想在進(jìn)行到一半時(shí)發(fā)現(xiàn)我正在做的事情會(huì)導(dǎo)致錯(cuò)誤/扼殺性能.這就是我正在考慮的設(shè)置方式.

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.

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

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.

我認(rèn)為這種方式最好,因?yàn)槲铱梢岳?android 自帶的所有優(yōu)秀組件,而不是使用 OpenGL 自己制作.但是我擔(dān)心混合這兩種視圖可能會(huì)出現(xiàn)一些問(wèn)題.任何見(jiàn)解或建議將不勝感激.謝謝.

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 作為第一個(gè)元素的 FrameLayout.IE.在堆棧的底部,其他視圖/視圖組位于其頂部.我建議只是暫停游戲循環(huán)并在其頂部放置一些不透明的視圖以隱藏它,而不是交換視圖或其他任何東西:

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>

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

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

相關(guān)文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環(huán)繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動(dòng)生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數(shù)據(jù)庫(kù))
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對(duì)象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 国产一区二区三区高清 | 日韩电影一区二区三区 | 久久久久亚洲 | japan21xxxxhd美女| 一区二区精品视频 | 视频一区二区在线 | 日韩久久综合 | 国产成人在线一区二区 | 久久骚 | 福利片在线 | 亚洲综合久久久 | 久久亚洲精品久久国产一区二区 | 国产精品久久精品 | 欧美一级在线免费 | 午夜看看 | 久久精品国产一区二区三区 | 久久午夜剧场 | 色综久久 | 精品中文在线 | 国产亚洲精品精品国产亚洲综合 | 一区观看| 亚洲电影一区二区三区 | 伦理午夜电影免费观看 | 中文字幕日韩欧美一区二区三区 | 亚洲传媒在线 | 亚洲免费精品一区 | 中文字幕在线观看第一页 | 日韩视频观看 | 日本特黄a级高清免费大片 成年人黄色小视频 | 欧美一区二区三区小说 | 欧美一级网站 | 黄色毛片在线播放 | 亚洲日本一区二区三区四区 | 男人天堂手机在线视频 | 午夜精品在线 | 欧美日韩亚洲一区二区 | 日本精品一区 | 玖玖国产精品视频 | 亚洲黄色高清视频 | 九九热在线免费视频 | 国产一区免费 |