public void gameStart() { mScoreBoard.getTransform().setPosition(-1.2f, 1.2f, -3.0f); mScoreBoard.setBackgroundColor(Color.BLUE); mScore = 0; mScoreBoard.setText("Score: 0"); mGameOver = false; mParticleSystem.setEnable(true); }
public void gameOver() { mParticleSystem.setEnable(false); mScoreBoard.getTransform().setPosition(0, 0, -2); mScoreBoard.setBackgroundColor(Color.RED); mScoreBoard.setText(mScoreBoard.getTextString() + "\nTap to play again"); mGameOver = true; }
GVRTextViewSceneObject makeScoreboard(GVRContext ctx) { GVRTextViewSceneObject scoreBoard = new GVRTextViewSceneObject(ctx, 3, 2, "Score: 0"); GVRRenderData rdata = scoreBoard.getRenderData(); scoreBoard.getTransform().setPosition(-1.2f, 1.2f, -3.0f); scoreBoard.setTextColor(Color.YELLOW); scoreBoard.setBackgroundColor(Color.BLUE); return scoreBoard; }
private void createDinosaurDescription() { description = new GVRTextViewSceneObject(getGVRContext(), DESCRIPTION_WIDTH, DESCRIPTION_HEIGHT, getGVRContext().getContext().getString(R.string.ankylosaurus_text)); description.setGravity(Gravity.LEFT); description.setTextColor(Color.BLACK); description.getTransform().setPositionY(2f); description.getRenderData().setRenderingOrder(RenderingOrderApplication.TEXT_BACKGROUND); description.setTextSize(5); description.setBackgroundColor(Color.WHITE); description.getTransform().setScale(0.3f, 0.3f, 0.3f); description.getTransform().setPosition(-.3f, 1.7f, 3f); addChildObject(description); description.getRenderData().getMaterial().setOpacity(0); }
scoreBoard.attachComponent(collider); scoreBoard.setTextColor(Color.YELLOW); scoreBoard.setBackgroundColor(Color.argb(0, 0, 0, 0)); scoreBoard.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL); rdata.setDepthTest(false);
mEndGameLabel.setBackgroundColor(Color.DKGRAY); mEndGameLabel.setTextColor(Color.WHITE); mEndGameLabel.setGravity(Gravity.CENTER);