Beispiel #1
0
		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) {
		}
Beispiel #3
0
		public abstract void Update(GameTime elapsedTime);
Beispiel #4
0
		public abstract void Draw(SpriteBatch batch, GameTime elapsedTime);
Beispiel #5
0
		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;
		}
Beispiel #6
0
 public abstract void Update(GameTime gameTime);