hi everyone i am making a game that i need to show an 2D array using GUI.
for example, i create an 2D array field[10][10]
this array contain 100elements of interger range from 1 to 9.
i want to show it on the GUI form but i dont know how to do it...
i hv try to make some lebal so lebal will show element of array like that
lebal->Text1=""+field[0][0]
but that is not practical to make 100 lebel...
is there better way to show that?
That depends on what GUI library you are using. One would usually make GUI dynamically in cases like yours. The position of these Gooeys are usually computed throught simple loop..
1 2 3 4 5 6
const FIX_WIDTH = 80; //this could represent pixels or other measuring unit
for (int i=0; i<10; i++)
{
posx = FIX_WIDTH * i;
//position your Gooey. . .
}