元のサイズにならないように縮小したい画像があります。
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);
ブリット:
if (drawBullet) //bool set to true in key event
{
SDL_BlitSurface(bullet, NULL, screen, &bulletRect);
}
SDL_Flip(screen);
唯一変化するのは、弾丸 (画像) の x、y 値を変更するときです。w、hを変更しても変更されず、カラーキーは効果がありません。
どうしたの?