views:

19

answers:

0

The problem I am having is I create two different menus from a single class. When I finish the first one, everything is fine. However when I create the second one and set it's region, it modifies the previous one as well. When I call Display() which just flips a boolean variable, it flips it for both instead of just the one I'm calling to.

cMenu* gameMenu;
cMenu* spellMenu;

  gameMenu = new cMenu();
 for(int i=0; i< 25; i++)
  gameMenu->AddButton("test", i);
 AddGameObject(gameMenu);

 spellMenu = new cMenu();
 spellMenu->SetRegion(580, 50, 52, 250, FORMAT_5X1); // This modifies gameMenu as well
 spellMenu->Display(); // So does this
 g.AddGameObject(spellMenu);