Original Post
This is actually my first message/thread at GameDev so be nice. ;) I'm curently working with a simple "menu" in SDL just to get me started with all the programming again. My "menu" is suppose to work like a standard pop-down menu like in any other program or OS. Problem: I want to be able to press my menu-button so it gets highlighted(two different pictures). The problem is when I first got it highlighted I can't press it again to non-highlight it. Part of the Code: //image is a SDL_Rect. "menu1.jpg" is the highlighted picture while "menu0.jpg" is the opposite. for(int x=image.x; x<image.w; x++) { for(int y=image.y; y<image.h; y++) { if(event.button.x==x && event.button.y==y && event.button.button==1 && event.button.state==SDL_PRESSED && menucheck==0) { DrawImage(screen, "menu1.jpg", image); SDL_Flip(screen); if(event.button.state==SDL_RELEASED)//The problem seems to be here because menucheck refuses to be changed to '1' so the second if-sentence can start. I've tried with "else if" to. menucheck=1; } if(event.button.x==x && event.button.y==y && event.button.button==1 && event.button.state==SDL_PRESSED && menucheck==1) { DrawImage(screen, "menu0.jpg", image); SDL_Flip(screen); if(event.button.state==SDL_RELEASED) menucheck=0; } } }