Ejemplo n.º 1
0
 public override void Draw(DrawContext drawContext, int tag, IDrawSmoothProvider sp)
 {
     if (!visible)
     {
         return;
     }
     base.Draw(drawContext, tag, sp);
 }
Ejemplo n.º 2
0
        // 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));
        }
Ejemplo n.º 3
0
 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);
     }
 }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
 public virtual void Draw(DrawContext drawContext, int tag, IDrawSmoothProvider sp)
 {
     currentAnimation.CurrentFrame.Draw(drawContext, GetRenderPosition(sp), facingLeft);
 }
Ejemplo n.º 6
0
 /// <summary>Implements IDrawObject.Draw</summary>
 public void Draw(DrawContext drawContext, int frameNumber, IDrawSmoothProvider sp)
 {
     AnimationSet.DefaultAnimation.Frames[frameNumber].Draw(drawContext, Position, FacingLeft, Color.White);
 }
Ejemplo n.º 7
0
 public void Draw(DrawContext drawContext, int tag, IDrawSmoothProvider sp)
 {
     AnimationSet.DefaultAnimation.Frames[0].Draw(drawContext, Position, FacingLeft);
 }