Hi, I'm currently working on a game that contains a visualization of the sound frequency effect in the background of a surfaceView.
The surfaceView contains actual game play.
I post code snippets: -
main.xml
<FrameLayout android:layout_width="fill_parent" android:layout_height="0dp" android:layout_margin="5dp" android:layout_weight="1" android:background="#000" > <co.ardor.visualizer.VisualizerView android:id="@+id/visualizerView" android:layout_width="fill_parent" android:layout_height="fill_parent" > </co.ardor.visualizer.VisualizerView> </FrameLayout>
Visualizer view are created as follows:
public class VisualizerView extends View { private static final String TAG = "VisualizerView"; private byte[] mBytes; private byte[] mFFTBytes; private Rect mRect = new Rect(); private Visualizer mVisualizer; private Set<Renderer> mRenderers;
My VisualizerView works well, as I can add this as a SurfaceView background (Actual running Game). I am stuck in the problem that "How to add VIEW as background of surfaceView?" or any other best solution for this. thanks in advance..
source share