public CameraScreen()
{
cameraImage = ResourceManager.CreateImage("photocamera");
if(CameraSystem.Instance.IsConnected(CameraType.PRIMARY))
{
if (CameraSystem.Instance.IsConnected(CameraType.SECONDARY))
{
btnType = new Button("To Secondary Camera") { Pivot = Vector2.One };
btnType.Released -= btnType_Released;
btnType.Released += btnType_Released;
AddComponent(btnType, Preferences.ViewportManager.BottomRightAnchor);
}
CameraSystem.Instance.SetCallbackImage(cameraImage);
btTakePhoto = new Button("Take a photo") { Pivot = Vector2.UnitY};
btTakePhoto.Released -= btTakePhoto_Released;
btTakePhoto.Released += btTakePhoto_Released;
AddComponent(btTakePhoto, Preferences.ViewportManager.BottomLeftAnchor);
}
btnStartStop = new Button("Start Camera") { Pivot = Vector2.One };
btnStartStop.Released -= btnStartStop_Released;
btnStartStop.Released += btnStartStop_Released;
AddComponent(btnStartStop, Preferences.ViewportManager.BottomRightAnchor - new Vector2(0, 40));
cameraLabel = new Sprite("camera", cameraImage) { Pivot = Vector2.UnitX / 2};
cameraLabel.Draggable = true;
cameraLabel.Scalable = true;
cameraLabel.Rotable = true;
AddComponent(cameraLabel, Preferences.ViewportManager.TopCenterAnchor);
}