Jump to content


Photo

Color problem!


  • Please log in to reply
1 reply to this topic

#1 GrayCircle

GrayCircle

    GMC Member

  • GMC Member
  • 26 posts
  • Version:GM8

Posted 16 February 2012 - 12:03 AM

Draw Event:
execute code:

for (l=1; l <= pauseText[pausePage,0]; l+=1) 
{
if (pauseSelected = l) 
{ 
draw_set_color(c_red)
} 
else 
{ 
draw_set_color(c_black) 
}
draw_text(x,y+(l*16)-16,pauseText[pausePage,l]);
}
if pausePage = 2 
{
draw_text(obj_pause.x-15,obj_pause.y-45,"Are you sure you want to the Main Menu?")
}
if pausePage = 0
{
draw_text(obj_pause.x+5,obj_pause.y-25,"Paused!")
}



Key Press Event for <Enter> Key:
execute code:

{
  switch(pausePage) {
    case 0: // Pause Menu
      if (pauseSelected = 1) 
      { 
      sound_play(accept_click)
      instance_destroy();
      instance_activate_all();
      draw_set_font(fnt_arial);
      } // Resume Game
      if (pauseSelected = 2) { sound_play(accept_click);pausePage = 2; pauseSelected = 1; } // Return to Main Menu
    break;
    case 2:
    if pausePage = 2
      { 
      if (pauseSelected = 1) 
      {
      sound_play(accept_click)
      room_goto(Menu_Screen);
      }
      if (pauseSelected = 2) 
      {
      sound_play(back_click)
      pausePage =0;
      pauseSelected=1;
      }
      }
    break;   
  }
}
A red color appears at the drawn text when variable,pauseText, is the last one. How can I fix this?

Edited by GrayCircle, 16 February 2012 - 12:03 AM.

  • 0

#2 Sirosky

Sirosky

    GMC Member

  • GMC Member
  • 1503 posts
  • Version:GM:Studio

Posted 16 February 2012 - 12:11 AM

Remember, when draw_set_color is applied, it affects all of the following events. So you would need another draw_set_color() afterwards to remove the red.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users