public override bool UpdateGame() { CWebcam.GetFrame(ref _WebcamTexture); Statics[htStatics(StaticWebcamOutput)].Texture = _WebcamTexture; SelectSlides[htSelectSlides(SelectSlideVideosToBackground)].Selection = (int)CConfig.VideosToBackground; return(true); }
private void _OnTakeSnapshot() { if (!CWebcam.IsDeviceAvailable()) { CDraw.RemoveTexture(ref _WebcamTexture); _Snapshot = null; _Buttons[_ButtonSaveSnapshot].Visible = false; _Buttons[_ButtonDiscardSnapshot].Visible = false; _Buttons[_ButtonTakeSnapshot].Visible = false; _Buttons[_ButtonWebcam].Visible = false; _SelectElement(_Buttons[_ButtonSave]); } else { CWebcam.Stop(); //Do this first to get consistent frame and bitmap _Snapshot = CWebcam.GetBitmap(); if (CWebcam.GetFrame(ref _WebcamTexture)) { _Statics[_StaticAvatar].Texture = _WebcamTexture; } _Buttons[_ButtonSaveSnapshot].Visible = true; _Buttons[_ButtonDiscardSnapshot].Visible = true; _Buttons[_ButtonTakeSnapshot].Visible = false; _Buttons[_ButtonWebcam].Visible = false; _SelectElement(_Buttons[_ButtonSaveSnapshot]); } }
public override bool UpdateGame() { if (CWebcam.GetFrame(ref _WebcamTexture)) { _Statics[_StaticWebcamOutput].Texture = _WebcamTexture; } _SelectSlides[_SelectSlideVideosToBackground].Selection = (int)CConfig.Config.Video.VideosToBackground; return(true); }
private void OnWebcam() { _Snapshot = null; CWebcam.Start(); CWebcam.GetFrame(ref _WebcamTexture); Buttons[htButtons(ButtonSaveSnapshot)].Visible = false; Buttons[htButtons(ButtonDiscardSnapshot)].Visible = false; Buttons[htButtons(ButtonTakeSnapshot)].Visible = true; Buttons[htButtons(ButtonWebcam)].Visible = false; }
public override bool UpdateGame() { if (_AvatarsChanged) { _LoadAvatars(true); } if (_ProfilesChanged) { _LoadProfiles(true); } if (_SelectSlides[_SelectSlideProfiles].Selection > -1) { _Buttons[_ButtonPlayerName].Text.Text = CProfiles.GetPlayerName(_SelectSlides[_SelectSlideProfiles].SelectedTag); if (_EditMode == EEditMode.PlayerName) { _Buttons[_ButtonPlayerName].Text.Text += "|"; } _SelectSlides[_SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(_SelectSlides[_SelectSlideProfiles].SelectedTag); _SelectSlides[_SelectSlideUserRole].Selection = (int)CProfiles.GetUserRoleProfile(_SelectSlides[_SelectSlideProfiles].SelectedTag); _SelectSlides[_SelectSlideActive].Selection = (int)CProfiles.GetActive(_SelectSlides[_SelectSlideProfiles].SelectedTag); int avatarID = CProfiles.GetAvatarID(_SelectSlides[_SelectSlideProfiles].SelectedTag); _SelectSlides[_SelectSlideAvatars].SelectedTag = avatarID; if (_Snapshot == null) { if (CWebcam.IsCapturing()) { if (CWebcam.GetFrame(ref _WebcamTexture)) { _Statics[_StaticAvatar].Texture = _WebcamTexture; } } else { _Statics[_StaticAvatar].Texture = CProfiles.GetAvatarTexture(avatarID); } } } return(true); }
public override bool UpdateGame() { if (SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection > -1) { Buttons[htButtons(ButtonPlayerName)].Text.Text = CProfiles.GetPlayerName(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); if (_EditMode == EEditMode.PlayerName) { Buttons[htButtons(ButtonPlayerName)].Text.Text += "|"; } SelectSlides[htSelectSlides(SelectSlideDifficulty)].Selection = (int)CProfiles.GetDifficulty(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); SelectSlides[htSelectSlides(SelectSlideGuestProfile)].Selection = (int)CProfiles.GetGuestProfile(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); SelectSlides[htSelectSlides(SelectSlideActive)].Selection = (int)CProfiles.GetActive(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); int avatarNr = CProfiles.GetAvatarNr(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); SelectSlides[htSelectSlides(SelectSlideAvatars)].Selection = avatarNr; if (CWebcam.GetDevices().Length > 0 && _WebcamTexture.index > 0) { if (_Snapshot == null) { CWebcam.GetFrame(ref _WebcamTexture); } Statics[htStatics(StaticAvatar)].Texture = _WebcamTexture; RectangleF bounds = new RectangleF(_WebcamTexture.rect.X, _WebcamTexture.rect.Y, _WebcamTexture.rect.W, _WebcamTexture.rect.H); RectangleF rect = new RectangleF(0f, 0f, _WebcamTexture.rect.W, _WebcamTexture.rect.H); CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop); } else { Statics[htStatics(StaticAvatar)].Texture = CProfiles.Avatars[avatarNr].Texture; } } return(true); }