Scripting, Code & Interaction: Difference between revisions

no edit summary
No edit summary
Line 341: Line 341:
Well, I'm not going to go into what an array is (look it up in the manual Wink), but yes, you can create an array of pointers.  You do this the same way you would create any other array.  So, if you wanted to create your own array of pointers to the first five GUI objects, you could do something like this:
Well, I'm not going to go into what an array is (look it up in the manual Wink), but yes, you can create an array of pointers.  You do this the same way you would create any other array.  So, if you wanted to create your own array of pointers to the first five GUI objects, you could do something like this:


GUI* MyGUIArray[5];
  GUI* MyGUIArray[5];
 
 
// game_start
  // game_start
int i = 0;
  int i = 0;
while (i < 5) {
  while (i < 5) {
  MyGUIArray[i] = gui[i];
    MyGUIArray[i] = gui[i];
  i++;
    i++;
  }
    }


Note that if you have less than 5 GUIs in your game, this WILL crash it.
Note that if you have less than 5 GUIs in your game, this WILL crash it.
Anonymous user