示例#1
0
        public override void draw(SpriteBatch batch, Vector2 cameraPos, float cameraOffset, int horizonY)
        {
            float depth = GlobalFunctions.calcDepth(mAnimation.mSpritePosition.Y, horizonY, 656);
            float scale = GlobalFunctions.calcScale(depth);

            Vector2 drawPos = mAnimation.mSpritePosition;

            drawPos.X -= cameraPos.X;
            drawPos.X *= scale;
            drawPos.X += cameraOffset;

            batch.Draw(mAnimation.mSpriteSourceTexture, drawPos, mAnimation.mCurrentCelLocation, GlobalFunctions.calcTint(depth), mRotation, mOrigin, scale, mAnimation.mSpriteEffects, depth);
        }