public virtual void Draw(GameTime gameTime, SpriteBatch spriteBatch, SpriteSortMode parentSortMode, BlendState parentBlendState) { if (Count == 0) { return; } int statesObjectsCount = Count; SpartaObject[] stateObjects = Array; for (int i = 0; i < statesObjectsCount; i++) { SpartaDrawable stateObject = stateObjects[i] as SpartaDrawable; if (stateObject == null) { continue; } else if (stateObject is SpartaCamera2D) { ((SpartaCamera2D)stateObject).Draw(gameTime, spriteBatch, parentSortMode, parentBlendState); } else { stateObject.Draw(gameTime, spriteBatch); } } }
protected virtual void OnModeChanged(SpartaStateMode oldMode, SpartaStateMode newMode) { if (newMode == SpartaStateMode.TransitionIn) { if (TransitionIn.transitionType != SpartaTransitionType.None) { if (BackBuffer == null) { BackBuffer = CreateBackBuffer(); } } SpartaTransitionAnimation.HandleTransition(this, animationEnded, TransitionIn); } else if (newMode == SpartaStateMode.TransitionOff) { if (TransitionOut.transitionType != SpartaTransitionType.None) { if (BackBuffer == null) { BackBuffer = CreateBackBuffer(); } } SpartaTransitionAnimation.HandleTransition(this, animationEnded, TransitionOut); } else { if (newMode == SpartaStateMode.Activated) { TransitionIn.transitionType = SpartaTransitionType.None; TransitionOut.transitionType = SpartaTransitionType.None; DrawPriority = false; } Transform = Matrix.Identity; } }
public override void Dispose() { if (TransitionAnimation != null) { TransitionAnimation.Dispose(); TransitionAnimation = null; } if (BackBuffer != null) { BackBuffer.Dispose(); BackBuffer = null; } base.Dispose(); }
protected virtual void UpdateOpacity(float opacity, SpartaObject[] children, int count) { if (count == 0) { return; } for (int i = 0; i < count; i++) { SpartaDrawable drawable = children[i] as SpartaDrawable; if (drawable == null) { return; } drawable.Opacity = opacity; } }
public virtual void LoadContent() { if (Count == 0) { return; } int statesObjectsCount = Count; SpartaObject[] stateObjects = Array; for (int i = 0; i < statesObjectsCount; i++) { SpartaDrawable stateObject = stateObjects[i] as SpartaDrawable; if (stateObject == null) { continue; } stateObject.LoadContent(); } }
public void Follow(SpartaDrawable item) { }