public void HideOverlay() { if (m_CurrentOverlayState == OverlayState.Visible) { m_CurrentOverlayState = OverlayState.Exiting; } }
void _createTipMenu(BuildContext context, ArrowDirection arrowDirection, Offset position, Size size) { dismiss(); float triangleY = arrowDirection == ArrowDirection.up ? position.dy : position.dy - CustomTextSelectionControlsUtils._kToolbarTriangleSize.height - this._getTipMenuHeight(context: context); _overlayState = Overlay.of(context: context); _overlayEntry = new OverlayEntry( _context => Positioned.fill( new GestureDetector( onTap: dismiss, child: new Container( color: CColors.Transparent, child: new Stack( children: new List <Widget> { new Positioned( top: triangleY, left: size.width / 2.0f + position.dx - 25 * this.tipMenuItems.Count, child: new _TipMenuContent( tipMenuItems: this.tipMenuItems, arrowDirection: arrowDirection ) ) } ) ) ) ) ); _isVisible = true; _overlayState.insert(entry: _overlayEntry); }
public void SetState(OverlayState state) { switch (state) { case OverlayState.normal: AdjustShroud(normalSettings); break; case OverlayState.injured: AdjustShroud(injuredSettings); break; case OverlayState.unconscious: AdjustShroud(unconsciousSettings); break; case OverlayState.crit: AdjustShroud(critcalSettings); break; case OverlayState.death: AdjustShroud(normalSettings); break; } currentState = state; }
public static void createView(CustomToastItem toastItem) { _overlayState = Overlay.of(context: toastItem.context); _overlayEntry = new OverlayEntry( _context => new CustomToastWidget( gravity: toastItem.gravity, new Container( width: MediaQuery.of(context: _context).size.width, alignment: Alignment.center, child: new Container( decoration: new BoxDecoration( color: toastItem.backgroundColor, borderRadius: BorderRadius.circular(radius: toastItem.radius) ), margin: EdgeInsets.symmetric(horizontal: 20), padding: EdgeInsets.fromLTRB(16, 10, 16, 10), child: new Text( data: toastItem.message, style: CTextStyle.PLargeTitle.copyWith(color: toastItem.textColor) ) ) ) ) ); _isVisible = true; _overlayState.insert(entry: _overlayEntry); _timer = Window.instance.run((TimeSpan)toastItem.duration, callback: dismiss); }
public void SetState(OverlayState state) { switch (state) { case OverlayState.normal: SetState(1f); break; case OverlayState.injured: SetState(0.50f); break; case OverlayState.unconscious: SetState(-0.25f); break; case OverlayState.crit: SetState(-0.75f); break; case OverlayState.death: SetState(-1.1f); break; } currentState = state; }
void Awake() { m_Instance = this; m_progress = new Progress <double>(); m_progress.ProgressChanged += OnProgressChanged; m_CurrentOverlayState = OverlayState.Hidden; m_OverlayStateTransitionValue = 0.0f; m_GUILogo = new RenderTexture(m_Size, m_Size, 0); SetText(""); RenderLogo(0.45f); }
public void SetOverlayTransitionRatio(float fRatio) { m_OverlayStateTransitionValue = m_OverlayStateTransitionDuration * fRatio; bool overlayWasActive = App.VrSdk.OverlayEnabled; App.VrSdk.SetOverlayAlpha(fRatio); if (!overlayWasActive && App.VrSdk.OverlayEnabled) { App.VrSdk.PositionOverlay(m_OverlayOffsetDistance, m_OverlayHeight); } m_CurrentOverlayState = OverlayState.Visible; }
void ShowLog() { if (state == OverlayState.OPENED_LOG) { state = OverlayState.CLOSED; logFrame.enabled = false; } else if (state == OverlayState.CLOSED) { state = OverlayState.OPENED_LOG; logFrame.enabled = true; } else { ShowCapturedGuys(); ShowLog(); } }
void ShowCapturedGuys() { if (state == OverlayState.OPENED_PIECE_LIST) { state = OverlayState.CLOSED; pieceListFrame.enabled = false; } else if (state == OverlayState.CLOSED) { state = OverlayState.OPENED_PIECE_LIST; pieceListFrame.enabled = true; } else { ShowLog(); ShowCapturedGuys(); } }
private void SetOverlayState(OverlayState state) { foreach (var pair in _overlays) { pair.Value.Visible = pair.Key == state; } var loadingOverlay = (_overlays[OverlayState.Recording] as RecordingOverlay); if (state == OverlayState.Recording) { loadingOverlay.StartTimer(); } else { loadingOverlay.StopTimer(); } this.Refresh(); }
void Update() { switch (m_CurrentOverlayState) { case OverlayState.Exiting: m_OverlayStateTransitionValue -= Time.deltaTime; App.VrSdk.SetOverlayAlpha( Mathf.Max(m_OverlayStateTransitionValue, 0.0f) / m_OverlayStateTransitionDuration); if (m_OverlayStateTransitionValue <= 0.0f) { m_OverlayStateTransitionValue = 0.0f; m_CurrentOverlayState = OverlayState.Hidden; App.VrSdk.OverlayEnabled = false; } break; case OverlayState.Hidden: case OverlayState.Visible: default: break; } }
//Triggers the fading in public void FadeIn() { state = overlay.GetPixel(1, 1).a < 1 ? OverlayState.FadingIn : OverlayState.FullyShown; }
private void FadeToBlack() { fadeStartTime = Time.time; SetBlackSlateEnabled(true); overlayState = OverlayState.FadingHiddenToBlack; }
private void FadeToVisible() { fadeStartTime = Time.time; SetOverlayVisible(true); overlayState = OverlayState.FadingBlackToVisible; }
private void FadeOut() { fadeStartTime = Time.time; overlayState = OverlayState.FadingVisibleToHidden; FadeOutCallback?.Invoke(); }
internal ImageOverlay(IPresentationImage image, OverlayState state) { _image = image; _manager = OverlayManagers.First(m => m.Name == state.Name); _state = state; }
private void Start() { SetOverlayVisible(false); SetBlackSlateVisible(true); overlayState = OverlayState.Black; }
public Overlay(GameInstance game) { this.game = game; this.state = OverlayState.FLY_IN; this.currentFrame = 0; }
private void Update() { // Animate overlay by interpolating alpha values, manage fade states float fadeProgress; switch (overlayState) { case OverlayState.FadingHiddenToBlack: fadeProgress = (Time.time - fadeStartTime) / _fadeDuration; if (fadeProgress > 1.0f) { SetBlackSlateAlpha(1.0f); overlayState = OverlayState.Black; FadeToVisible(); } else { SetBlackSlateAlpha(Mathf.Clamp01(fadeProgress)); } break; case OverlayState.FadingBlackToVisible: fadeProgress = (Time.time - fadeStartTime) / _fadeDuration; if (fadeProgress > 1.0f) { SetBlackSlateVisible(false); overlayState = OverlayState.Visible; DelayForSeconds(FadeOut, overlayTimeout); rewindStartTime = Time.time; rewindingDaysCounter = true; } else { SetBlackSlateAlpha(Mathf.Clamp01(1.0f - fadeProgress)); } break; case OverlayState.Visible: if (rewindingDaysCounter) { float rewindProgress = (Time.time - rewindStartTime) / dayCounterRewindDuration; if (rewindProgress > 1.0f) { rewindingDaysCounter = false; ProgressDisplay.SetDaysSurvived(0); } else { ProgressDisplay.SetDaysSurvived((int)Mathf.Lerp(rewindStartDays, 0.0f, rewindProgress)); } } break; case OverlayState.FadingVisibleToHidden: fadeProgress = (Time.time - fadeStartTime) / _fadeDuration; if (fadeProgress > 1.0f) { SetOverlayVisible(false); overlayState = OverlayState.Hidden; } else { SetOverlayAlpha(Mathf.Clamp01(1.0f - fadeProgress)); } break; } }
//Triggers the fading in public void FadeOut() { state = overlay.GetPixel(1, 1).a > 0 ? OverlayState.FadingOut : OverlayState.FullyFaded; }
void _createTipMenu(BuildContext context, ArrowDirection arrowDirection, Offset position, Size size) { dismiss(); var width = MediaQuery.of(context: context).size.width - 32 * this.tipMenuItems.Count; float tipMenuHeight = this._getTipMenuHeight(context: context); float triangleY = arrowDirection == ArrowDirection.up ? position.dy : position.dy - CustomTextSelectionControlsUtils._kToolbarTriangleSize.height - tipMenuHeight; float left; float childCenterX = size.width / 2.0f + position.dx; if (childCenterX >= width) { left = width - 32 * this.tipMenuItems.Count - 16; } else { left = childCenterX - 32 * this.tipMenuItems.Count; } List <Widget> children; if (arrowDirection == ArrowDirection.down) { children = new List <Widget> { new Positioned( top: triangleY, left: left, child: new _TipMenuContent( tipMenuItems: this.tipMenuItems ) ), new Positioned( top: triangleY + tipMenuHeight, left: childCenterX, child: new _TipMenuTriangle( arrowDirection: arrowDirection ) ) }; } else { children = new List <Widget> { new Positioned( top: triangleY, left: childCenterX, child: new _TipMenuTriangle( arrowDirection: arrowDirection ) ), new Positioned( top: triangleY + CustomTextSelectionControlsUtils._kToolbarTriangleSize.height, left: left, child: new _TipMenuContent( tipMenuItems: this.tipMenuItems ) ) }; } _overlayState = Overlay.of(context: context); _overlayEntry = new OverlayEntry( _context => Positioned.fill( new GestureDetector( onTap: dismiss, child: new Container( color: CColors.Transparent, child: new Stack( children: children ) ) ) ) ); _isVisible = true; _overlayState.insert(entry: _overlayEntry); }