Add title to gamingview

This commit is contained in:
Ruben 2016-09-10 15:59:10 +01:00
parent 02cf5d6065
commit 1f5c96816b
2 changed files with 10 additions and 16 deletions

View file

@ -88,6 +88,7 @@ public class GamingActivity extends AppCompatActivity implements Detector.ImageL
mContentView = (TextView) findViewById(R.id.fullscreen_content); mContentView = (TextView) findViewById(R.id.fullscreen_content);
RelativeLayout videoLayout = (RelativeLayout) findViewById(R.id.video_layout); RelativeLayout videoLayout = (RelativeLayout) findViewById(R.id.video_layout);
TextView titleText = (TextView) findViewById(R.id.titleText);
//We create a custom SurfaceView that resizes itself to match the aspect ratio of the incoming camera frames //We create a custom SurfaceView that resizes itself to match the aspect ratio of the incoming camera frames
cameraPreview = new SurfaceView(this) { cameraPreview = new SurfaceView(this) {
@ -143,6 +144,7 @@ public class GamingActivity extends AppCompatActivity implements Detector.ImageL
// currentScenario = new ScenarioAnger(this); // currentScenario = new ScenarioAnger(this);
currentScenario = new Scenario(scenarioLvlId, this); currentScenario = new Scenario(scenarioLvlId, this);
currentScenario.init(); // "start the clock"... currentScenario.init(); // "start the clock"...
scenarioView = new ScenarioView(this, currentScenario); scenarioView = new ScenarioView(this, currentScenario);
@ -159,6 +161,8 @@ public class GamingActivity extends AppCompatActivity implements Detector.ImageL
Typeface font = Typeface.createFromAsset(getAssets(), "unifont-9.0.02.ttf"); Typeface font = Typeface.createFromAsset(getAssets(), "unifont-9.0.02.ttf");
mContentView.setTypeface(font); mContentView.setTypeface(font);
titleText.setText(currentScenario.game.toString());
titleText.setTypeface(font);
} }
public void startGame() { public void startGame() {

View file

@ -30,21 +30,11 @@
android:paddingBottom="100dp" /> android:paddingBottom="100dp" />
<FrameLayout <TextView
android:id="@+id/ending_layout" android:layout_width="wrap_content"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="match_parent" android:id="@+id/titleText"
android:fitsSystemWindows="true"> tools:text='"A spectacular level"'
android:layout_margin="@dimen/fab_margin" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/highscores"
android:textColor="@color/highscore"
android:textSize="30sp"
android:visibility="gone"
/>
</FrameLayout>
</FrameLayout> </FrameLayout>