Lut,
j'ai un BMP sur font jaune et je voudrais demander à SDL de transformer le jaune par de la transparence.
sfc_image=SDL_LoadBMP(image);
et ensuite je dois sûrement ajouter quelque chose.
Tu sais comment faire?
SDL_SetColorKey( surface->image, SDL_SRCCOLORKEY, surface->image->format->Rmask );
SDL_SetColorKey( sfc_image->image, SDL_SRCCOLORKEY, sfc_image->image->format->Rmask | sfc_image->image->format->Gmask);
SDL_MapRGB(sfc_image->image->format, 255, 255, 0);
essaiSDL.c:70: error: structure has no member named `image'
SDL_SetColorKey( sfc_image, SDL_SRCCOLORKEY, sfc_image->format->Rmask | sfc_image->format->Gmask);
et
SDL_MapRGB(sfc_image->format, 255, 255, 0);
/*Chargement des variables positions des surfaces*/
SDL_Rect position_soldat1;
/*Définition des positions de soldat1*/
position_soldat1.x=10;
position_soldat1.y=10;
/*Affichage du soldat1*/
SDL_BlitSurface(sfc_soldat1, NULL, sfc_fenetre, &position_soldat1);
/*Mettre à jour l'affichage*/
SDL_UpdateRect(sfc_fenetre, 0, 0, 0, 0);
/*Incrément position*/
position_soldat1.y--;
/*Affichage du soldat1*/
SDL_BlitSurface(sfc_soldat1, NULL, sfc_fenetre, &position_soldat1);
/*Mettre à jour l'affichage*/
SDL_UpdateRect(sfc_fenetre, 0, 0, 0, 0);
/*Effacement de soldat1*/
SDL_FillRect(sfc_soldat1, NULL, 0 );
Retourner vers Besoin d'aide en SDL ?
Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 2 invités