public Rectangle Draw(GameTime gameTime, SpriteBatch spriteBatch, Vector2 destination, float layerDepth, float entityScaleX, float entityScaleY, float opacity, float maxY, ViewPortInfo viewPortInfo)
{
int width = GetWidth(gameTime);
int height = GetHeight(gameTime);
int targetWidth = (int)Math.Ceiling(width * entityScaleX * viewPortInfo.ActualZoom * this.ScaleX);
int targetHeight = (int)Math.Ceiling(height * entityScaleY * viewPortInfo.ActualZoom * this.ScaleY);
// Draw the Object based on the current Frame dimensions and the specified Object Width Height values.
Rectangle objectDestRect = new Rectangle(
(int)Math.Ceiling(destination.X) + (int)Math.Ceiling(Offset.X * viewPortInfo.ActualZoom),
(int)Math.Ceiling(destination.Y) + (int)Math.Ceiling(Offset.Y * viewPortInfo.ActualZoom),
targetWidth,
targetHeight
);
Vector2 targetOrigin = new Vector2(
(float)Math.Ceiling(Drawable.Origin.X * width),
(float)Math.Ceiling(Drawable.Origin.Y * height)
);
Color targetColor = new Color()
{
R = Color.R,
G = Color.G,
B = Color.B,
A = (byte)(Color.A * opacity)
};
// Further adjust the layer depth based on this drawables layer value
layerDepth += Layer / maxY;
if (layerDepth > 1) layerDepth = 1;
if (layerDepth < 0) layerDepth = 0;
Drawable.Draw(spriteBatch, objectDestRect, targetColor, Rotation, targetOrigin, SpriteEffects, layerDepth, GetElapsedMS(gameTime));
return objectDestRect;
}