Posted By: nikka08
Creating A Grid - 03/22/10 03:00
Hi all. I'm trying to create a loop to generate a 2D 32*32 grid across the 1024*768 screen. In each cell, I would like a PANEL.
I tried using a couple simple array variables, but I came up with a few problems.
1) Can a panel be created within a while() loop using a name based on the array variable? i.e.-PANEL* Grid(1); PANEL* Grid(2)...
2) I seem to be having a problem using:
PANEL* Grid(1) =
{pos_x = grid_x[1]; pos_y = grid_y[1]}
It keeps giving me a syntax error on the "pos_x = grid_x[1];" line.
Basically, I'm trying to have a loop do the following:
Panel at 0,0
Panel at 0,32
Panel at 0,64....etc.
I seem to be going about it from the wrong direction, could someone please help me?
I tried using a couple simple array variables, but I came up with a few problems.
1) Can a panel be created within a while() loop using a name based on the array variable? i.e.-PANEL* Grid(1); PANEL* Grid(2)...
2) I seem to be having a problem using:
PANEL* Grid(1) =
{pos_x = grid_x[1]; pos_y = grid_y[1]}
It keeps giving me a syntax error on the "pos_x = grid_x[1];" line.
Basically, I'm trying to have a loop do the following:
Panel at 0,0
Panel at 0,32
Panel at 0,64....etc.
I seem to be going about it from the wrong direction, could someone please help me?