- Sort Posts
- 6 replies
- Last post
Show text over the video
Show text over the video
Show text over the video
Hi,
using the ImageTargets sample as a reference, you can add a simple TextView on top of your AR view by adding some code like the following in ImageTargets.java:
in the method initApplicationAR(), at the end of the function, you can add this code:
mTextView = new TextView(this); mTextView.setText("Hello"); mTextView.setVisibility(View.VISIBLE); addContentView(mTextView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
then, in the updateApplicationStatus(), right after the line of code < mUILayout.bringToFront(); > add this line:
mTextView.bringToFront();
Then of course you can adjust the code to place the textView differently, for instance in the center of the screen, etc., but that's about Android programming.
Show text over the video
Hi,
I have managed to place text over the video following this example but I have problems setting the position of the text on the screen, I have two textviews but they overlap each other on the top-left corner and can't find the way to move them on each corner (righ-left) of the screen. I'm wondering if you can advise me on this issue?
Thanks in advance.
Show text over the video
This depends on the specific LayoutParams you are using to add the TextView (see addContentView);
but this is out of scope for Vuforia, you should really look at the Android developer guide on how to best implement your desired layout.
http://developer.android.com/guide/topics/ui/declaring-layout.html
Hi, do you want to show thr Text on top of the Augmneted Reality view (i.e. when you are still seeing the target in 3D ) ?
And, does the Text label needs to be located at a specific location on the screen ?