project2D/Entity.cpp
//--------------------------------------------------------------------------------------
// Draw: A virtual function to render (or "draw") objects to the screen.
//
// Param:
//		renderer2D: a pointer to Renderer2D for rendering objects to screen.
//--------------------------------------------------------------------------------------
A virtual function to render (or "draw") objects to the screen.
Param:
renderer2D: a pointer to Renderer2D for rendering objects to screen.
A virtual function to render ( or " draw " ) objects to the screen . Param : renderer2D : a pointer to Renderer2D for rendering objects to screen .
void Entity::Draw(Renderer2D* renderer2D)
{
	if (texture)
	{
		renderer2D->drawSpriteTransformed3x3(texture, GlobalTrasform);
	}
	renderer2D->drawLine(boundingBox.LowerLeft.x, boundingBox.LowerLeft.y, boundingBox.UpperRight.x, boundingBox.UpperRight.y, 10, 0);
	for (int i = 0; i < children.size(); i++)
	{
		children[i]->Draw(renderer2D);
	}
}
void Entity :: Draw ( Renderer2D * renderer2D ) { if ( texture ) { renderer2D -> drawSpriteTransformed3x3 ( texture , GlobalTrasform ) ; } renderer2D -> drawLine ( boundingBox . LowerLeft . x , boundingBox . LowerLeft . y , boundingBox . UpperRight . x , boundingBox . UpperRight . y , 10 , 0 ) ; for ( int i = 0 ; i < children . size ( ) ; i ++ ) { children [ i ] -> Draw ( renderer2D ) ; } }
Draw: A virtual function to render (or "draw") objects to the screen.
Draw : A virtual function to render ( or " draw " ) objects to the screen .
// if it has a texture draw it // Draw bounding boxes // Draw all of the children in entity