public void Draw(SpriteBatch spriteBatch,
int XOffset,
int YOffset,
bool NeedBeginEnd)
{
if (NeedBeginEnd)
spriteBatch.Begin();
spriteBatch.Draw(
t2dTexture,
new Rectangle(
xPosition + XOffset,
yPosition + YOffset,
widthOfFrame,
heightOfFrame),
GetSourceRect(),
Color.White);
if (NeedBeginEnd)
spriteBatch.End();
}