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; }
public static GVRTextViewSceneObject createLabel(GVRContext context, float x, float y, float z) { GVRTextViewSceneObject textObject = new GVRTextViewSceneObject(context, 5f, 2f, "00"); textObject.setTextColor(Color.BLACK); textObject.setGravity(Gravity.CENTER); textObject.setTextSize(20); textObject.setRefreshFrequency(GVRTextViewSceneObject.IntervalFrequency.LOW); textObject.getTransform().setPosition(x, y, z); return textObject; } }
public Banner(GVRContext context, String text, int size, int color, float posX, float posY, float posZ) { message = new GVRTextViewSceneObject(context, text); message.setGravity(Gravity.CENTER); message.setTextSize(size); message.setTextColor(color); message.getTransform().setPosition(posX, posY, posZ); message.getRenderData().setRenderingOrder(GVRRenderData.GVRRenderingOrder.TRANSPARENT); }
private void createDinosaurTitle() { Resources resources = gvrContext.getActivity().getResources(); String stringTitle = getGVRContext().getContext().getString(R.string.ankylosaurus_title); Bitmap titleBitmap = BitmapFactory.decodeResource(resources, R.drawable.title_background); BitmapDrawable background = new BitmapDrawable(resources, titleBitmap); title = new GVRTextViewSceneObject(gvrContext, TITLE_WIDTH, TITLE_HEIGHT, stringTitle); title.setRefreshFrequency(IntervalFrequency.LOW); title.setTextColor(Color.BLACK); title.setBackGround(background); title.getTransform().setScale(0.3f, 0.3f, 0.3f); title.setTextSize(16); title.setGravity(android.view.Gravity.CENTER_HORIZONTAL); title.getTransform().setPosition(-2f, 2.6f, 3f); addChildObject(title); title.getRenderData().getMaterial().setOpacity(0); }
public void createSubText(String text) { subText = new GVRTextViewSceneObject(getGVRContext(), TEXT_WIDTH, TEXT_HEIGHT / 2, text); subText.setTextColor(Color.WHITE); subText.setTextSize(3); subText.setGravity(Gravity.CENTER); subText.getTransform().setPosition(0, SUB_TEXT_Y, TEXT_BACKGROUND_Z + 0.01f); subText.getRenderData().setRenderingOrder(RenderingOrderApplication.IMAGE_TEXT); subText.getRenderData().getMaterial().setOpacity(0); addChildObject(subText); }
private void createMainText(String text) { mainText = new GVRTextViewSceneObject(getGVRContext(), TEXT_WIDTH, TEXT_HEIGHT / 2, text); mainText.setTextColor(Color.WHITE); mainText.setTextSize(5); mainText.setGravity(Gravity.CENTER); mainText.getTransform().setPosition(0, MAIN_TEXT_Y, TEXT_BACKGROUND_Z + 0.01f); mainText.getRenderData().setRenderingOrder(RenderingOrderApplication.IMAGE_TEXT); mainText.getRenderData().getMaterial().setOpacity(0); addChildObject(mainText); }
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.setTextColor(Color.YELLOW); scoreBoard.setBackgroundColor(Color.argb(0, 0, 0, 0)); scoreBoard.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL);
mEndGameLabel.setTextColor(Color.WHITE); mEndGameLabel.setGravity(Gravity.CENTER); mEndGameLabel.getTransform().setPosition(0f, 9f, -4f);