package my.name;

import android.app.Activity;
import android.os.Bundle;
import android.widget.FrameLayout;

public class MascotActivity extends Activity {
	BitmapView view;
	public BitmapView getView() { return view; }

	Sound sound;
	public Sound getSound() { return sound; }

	Script script;
	public Script getScript() { return script; }
	
	Shaker shaker;

	CameraView cameraView;
	public CameraView getCameraView() { return cameraView; }
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		view=new BitmapView(this);
		sound=new Sound(this);
		shaker=new Shaker(this);
		cameraView=new CameraView(this);
		script=new Script(this);

		FrameLayout f=new FrameLayout(this);
		f.addView(cameraView);
		f.addView(view);
		setContentView(f);
	}
	
	@Override
	protected void onResume() {
		super.onResume();
		view.onResume();
		sound.onResume();
		shaker.onResume();
		script.run(0);
	}
	
	@Override
	protected void onPause() {
		super.onPause();
		view.onPause();
		sound.onPause();
		shaker.onPause();
	}
}

