2011-03-02 3 views

답변

4

나는 당신의 GameView가 바로 그래픽 그리기 이후 캔버스를 가지고 있다고 가정? 당신이 당신의 그림의 나머지를 할 경우에,

//canvas.drawText(String text, float x, float y, Paint paint); this is the actual method 
canvas.drawText(score, 5, 5, null); //but yours would look more like this 

그럼 그냥 "점수"문자열을 생성하고이 게임에서 업데이트해야 할 것이다 사용합니다.

또한 addView (하위보기)를 사용해 볼 수도 있습니다. 여기

GameView.addView(TextView); 
2

약간의 뻔뻔한 자기 홍보를하지만 Hexaddicus 훔쳐 경우 당신은 우리가 게임보기 및 일반 오래된 뷰 물건 바닥 글로 화면을 분할 것을 볼 수 있습니다 : 그것은 다음과 같을 것이다. 이것은 내 모습이 아니지만가는 것입니다 방법입니다. 더 많은 인라인 모양과 느낌을 원한다면 분명히이 길로 내려 가지 않아야합니다.

그냥 Android UI 위젯을 게임보기에 오버레이하려고합니다.

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 
<FrameLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/control_pane" 
    android:layout_width="fill_parent" 
    android:layout_height="48dip" 
    android:layout_alignParentBottom="true"> 
</FrameLayout> 
<com.sharpermindstech.android.hexaddicus.opengl.views.HexBoardView 
    android:id="@+id/gamefield" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_centerHorizontal="true" 
    android:layout_above="@id/control_pane" /> 
</RelativeLayout> 
관련 문제