0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
for ($i = 1; $i != 101; $i++)
{
c('Text' . $i)->free();
c("Block".$i)->free();
}
$y = array(
1 => ceil(rand(0, 450) / 50) * 50
);
$x = array(
1 => ceil(rand(0, 450) / 50) * 50
);
for ($i = 1; $i != 100; $i++)
{
array_push($x, ceil(rand(0, 500) / 50) * 50);
array_push($y, ceil(rand(0, 450) / 50) * 50);
}
for ($i = 1; $i != count($x) + 1; $i++)
{
$block = new TShape();
$block->w = 50;
$block->h = 50;
$block->x = $x[$i];
$block->y = $y[$i];
$block->name = 'Block' . $i;
$block->parent = c("Form1");
$text = new TLabel();
$text->x = $x[$i];
$text->y = $y[$i];
$text->w = 50;
$text->h = 50;
$text->name = 'Text' . $i;
$text->parent = c("Form1");
$text->caption = $i;
$text->font->size = 20;
}
Рандомный генератор динамический кубов в поле 500x500.
Запостил:
NodnolStudio ,
08.12.2016 (Updated 31.03.2018 )
паскалевое наследие чувствую я