public override void Draw(DrawContext drawContext, int tag, IDrawSmoothProvider sp) { if (!visible) { return; } base.Draw(drawContext, tag, sp); }
// NOTE: Two versions of this method in case we want to play with not smoothing for sorting (so positions are always physically possible) // while still smoothing out actual drawing positions. public Position GetRenderPosition(IDrawSmoothProvider smoothProvider) // <- DRAWING { if (smoothProvider == null) // <- Due to Sauna.cs drawing stuff from the UI, this is possible. { return(position); } return(position + smoothProvider.GetOffset(this)); }
public virtual void RegisterShadow(ShadowCasterList shadowCasterList, Definitions definitions, IDrawSmoothProvider sp) { if (animationSet.shadowLayers != null) { shadowCasterList.AddShadowCaster(animationSet.shadowLayers, animationSet.cachedShadowBounds, animationSet.physicsStartX, animationSet.physicsEndX, GetRenderPosition(sp), CurrentFrame.shadowOffset, facingLeft); } }
public void DrawAll(DrawContext context, IDrawSmoothProvider sp) { Debug.Assert(IsSorted); // <- Expect our caller to have sorted! int vertexCount = this.Count; for (int i = vertexCount - 1; i >= 0; i--) // The topological sort returns in front-to-back order { DrawingInfo di = drawingInfo[sortedOrder[i]]; #if DEBUG CheckAllowedToDraw(di.drawObject, di.tag); #endif di.drawObject.Draw(context, di.tag, sp); } }
public virtual void Draw(DrawContext drawContext, int tag, IDrawSmoothProvider sp) { currentAnimation.CurrentFrame.Draw(drawContext, GetRenderPosition(sp), facingLeft); }
/// <summary>Implements IDrawObject.Draw</summary> public void Draw(DrawContext drawContext, int frameNumber, IDrawSmoothProvider sp) { AnimationSet.DefaultAnimation.Frames[frameNumber].Draw(drawContext, Position, FacingLeft, Color.White); }
public void Draw(DrawContext drawContext, int tag, IDrawSmoothProvider sp) { AnimationSet.DefaultAnimation.Frames[0].Draw(drawContext, Position, FacingLeft); }