By GabrielS
on Fri, 08/31/2012 - 09:53
Hi,
I would like the user of my application to click on AR.
For that, i have been able to get in Java the coordinates of the AR (from the function renderFrame in the matrix modelViewProjection (data[12] and data[13]).
But I can't move the Android button (even with setHeight / setLeft / setBottom).
[code]_dynamicButton.setClickable(true); _dynamicButton.setOnClickListener(listenerInfoApplicationButton); _dynamicButton.setText("x="+coordAR[0]+" y="+coordAR[1]); _dynamicButton.setLeft(coordAR[0]*200); _dynamicButton.setHeight(coordAR[0]);[/code]
The text of the button is ok, it changes but the button does'nt move...
Any idea?
Thanks in advance
Moving an Android Button depending on where is the AR.
Is the button in a layout? If so, perhaps its position is contrained.
Moving an Android Button depending on where is the AR.
I think you can "hack" it by using margins. Set button in a relative layout top left then change the margins depending on where the trackable is
eg:
setLeftMargin(trackable x position in screen space)
set topMargin(trackably y position in screen space)