我有一张图片,我想把它缩小,使它不是原来的大小。
SDL_Rect bulletRect;
bulletRect.x = 10;
bulletRect.y = 10;
bulletRect.w = 10;
bulletRect.h = 10;
SDL_Surface *bullet = IMG_Load("/Users/tonymichaelsen/Documents/documents/Xcode-projects/c++/c++/bullet.png");
Uint32 colorKeyBullet = SDL_MapRGB(bullet->format, 255, 255, 255);
SDL_SetColorKey(bullet, SDL_SRCCOLORKEY, colorKeyBullet);
Blitted:
if (drawBullet) //bool set to true in key event
{
SDL_BlitSurface(bullet, NULL, screen, &bulletRect);
}
SDL_Flip(screen);
唯一改变的是当我改变子弹(图像)的 x,y 值时。当我改变 w,h 时它不会改变并且颜色键没有效果。
怎么了?