public void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { this.otherScreenHasFocus = otherScreenHasFocus; if (this._isExiting) { this._drawableState = Painting.DrawableState.TransitionOff; if (!this.UpdateTransition(gameTime, this.transitionOffTime, 1)) { this.drawableScreen.RemoveDrawable(this); } } else if (coveredByOtherScreen) { if (this.UpdateTransition(gameTime, this.transitionOffTime, 1)) { this._drawableState = Painting.DrawableState.TransitionOff; } else { this._drawableState = Painting.DrawableState.Hidden; } } else if (this.UpdateTransition(gameTime, this.transitionOnTime, -1)) { this._drawableState = Painting.DrawableState.TransitionOn; } else { this._drawableState = Painting.DrawableState.Active; } Update(gameTime); }
public void Draw(SpriteBatch batch, GameTime gameTime) { }
public abstract void Update(GameTime elapsedTime);
public abstract void Draw(SpriteBatch batch, GameTime elapsedTime);
private bool UpdateTransition(GameTime gameTime, float time, int direction) { float num; if (time == 0f) { num = 1f; } else { num = (gameTime.GetElapsedGameTime() / time); } this._transitionPosition += num * direction; if (((direction < 0) && (this._transitionPosition <= 0f)) || ((direction > 0) && (this._transitionPosition >= 1f))) { this._transitionPosition = MathUtils.Clamp( this._transitionPosition, 0f, 1f); return false; } return true; }
public abstract void Update(GameTime gameTime);