By silentem
on Mon, 10/22/2012 - 17:25
Hi
I'm working with de ImageTargets example, i want to show a View when trackable is detected, and hide the View when there's no trackables detected.
I already have the layout, and can show the View on screen, but i don't know how to hide the view when the trackable is no longer on camera.
Can someone please help me?
Show and hide a View
Hi, a View (in Android) can be hidden just by calling view.setVisibility( VIEW.GONE );
does it answer your question?
Show and hide a View
Hi
I've been investigating, the line i think is view.setVisibility(view.INVISIBLE), but i think i need to change the ImageTargets.cpp?
That's my question.
I'm not shure if this is right.
Thanks in advance.
Show and hide a View
Hi, in ImageTargets.cpp you will find the code that checks if there are any active trackables in the current view (see the "for loop" with "state.getNumActiveTrackables()" in the _renderFrame method)
Show and hide a View
Hi again Alessandro
Thanks for the response
I think I understand a little the idea but I have not entirely clear. I'll keep investigating and reading a little more.
Show and hide a View
Hi, concerning the link that you cannot acess, I'm copying the text here below:
Show and hide a View
Hi Alessandro
Actually I had found this information, this is how I show in this moment the View on screen.
My problem it's i don't know how i need to program the JNI to show and hide the View when trackable it's detected.
Show and hide a View
You can choose how many classes to create in Java and how you spread the code through the application (so there are many ways of achieveing the same result);
the only couple of RULES to keep in mind when working with JNI are these:
Show and hide a View
Hi Alessandro
Thank you for the explanation, that helped me a lot.
Show and hide a View
Hi, happy to hear I was helpful :-)
About your code: it looks all right, but not sure what you mean by doing "id = 1" or "id = 2" (it's not clear how the id variable is used in your code) .... also, what is your doubt in particular?
Show and hide a View
Hi
That's a temporary code to get an id to send it to a data base, but works fine.
My doubt it's on the part of the first "if".
Show and hide a View
OK, the problem could likely be that you only send a message to the Handler for each trackable detected (from the _renderFrame() code in ImageTargets.cpp), but maybe you also need to say that a certain Trackable (e.g.
Show and hide a View
How do i make the ImageTracker have a transparent shader so that i can have stuff coming up from below the 'ground'
I tried to change to Ulint /trans shader but it swaps it back at runtime.
Show and hide a View
Hi Warren, is this related to Android or to Unity ?
if that's about Unity, please post it in the Unity section of the Forum.