Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: arj0n on Sun 08/08/2010 10:11:18

Title: Max amount of buttons on a gui
Post by: arj0n on Sun 08/08/2010 10:11:18
Can't find it on the forum: is there a max amount of buttons on a gui and if so, what is the amount?
Title: Re: Max amount of buttons on a gui
Post by: GarageGothic on Sun 08/08/2010 10:17:15
30 controls per GUI, I don't think the type makes any difference. There's a page in the manual titled "system limits" where you can find that kind of info.
Title: Re: Max amount of buttons on a gui
Post by: arj0n on Sun 08/08/2010 10:18:15
Quote from: GarageGothic on Sun 08/08/2010 10:17:15
There's a page in the manual titled "system limits" where you can find that kind of info.
Thanx for the info.
Title: Re: Max amount of buttons on a gui
Post by: monkey0506 on Mon 09/08/2010 17:08:24
In the event that limit is ever changed, you can use the constant AGS_MAX_CONTROLS_PER_GUI directly in your script to make it forward/backward compatible:

Button *buttons[AGS_MAX_CONTROLS_PER_GUI];
int i = 0;
while (i < AGS_MAX_CONTROLS_PER_GUI) {
  // ...
  buttons[i] = ...;
  i++;
}


I don't know if you were asking specifically for design purposes, scripting purposes, otherwise, or any combination thereof, but it makes your code safer. ;)