// void Render ( )
//
// Render the sprite to the screen
void CSprite::Render ( )
{
// Create graphics object
Graphics g( pong.hMemDC );
wstring ws ( mImg.begin(), mImg.end() );
// Load the image
Image image( ws.c_str() );
// create a textured brush
TextureBrush tBrush( ℑ );
// Draw and fill the rectangle
g.FillRectangle(&tBrush, mX, mY, mWidth, mHeight);
}
Anyone know any ways around this?
[edited by - luridcortex on April 4, 2004 12:17:10 AM]
Texturing Brushes in GDI+
Sup all, im working with GDI+ to try and make a simple 2D game. Im using textured brushes for sprites, but GDI+ keeps wanting to tile them. For instance if you fill a rectangle with a image brush and then move it about the screen the image wont move with the rectangle, it will just scroll down and tile the image.
Heres my code:
Why are you using a texture brush? The textured brush automatically tiles (that''s its purpose). If I understand what you are trying to do correctly, using Graphics::DrawImage() is what you want.
Colin Jeanne | Invader''s Realm
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud
Colin Jeanne | Invader''s Realm
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement