Split Square Into Smaller Squares
#3

Quote:
Originally Posted by NaS
Посмотреть сообщение
Код:
splitsquares(Float:sizeX = 100.0, Float:sizeY = 100.0, num = 5)
{
new Float:offsetX = sizeX / num, Float:offsetY = sizeY / num;

for(new x = 0; x < num; x ++) for(new y = 0; y < num; y ++)
{
new Float:minX = x * offsetX, Float:maxX = minX + sizeX;
new Float:minY = y * offsetY, Float:maxY = minY + sizeY;

// Do stuff with minX, maxX, minY, maxY...
}
}
Correct me if wrong, but isn't that code going to generate 25 squares?

EDIT: I mean, I don't think that would work with a strict amount of squares.
Reply


Messages In This Thread
Split Square Into Smaller Squares - by Redirect Left - 02.02.2018, 23:51
Re: Split Square Into Smaller Squares - by NaS - 02.02.2018, 23:59
Re: Split Square Into Smaller Squares - by Marricio - 03.02.2018, 00:17
Re: Split Square Into Smaller Squares - by NaS - 03.02.2018, 00:19
Re: Split Square Into Smaller Squares - by Marricio - 03.02.2018, 00:20
Re: Split Square Into Smaller Squares - by NaS - 03.02.2018, 00:28
Re: Split Square Into Smaller Squares - by Redirect Left - 03.02.2018, 16:58
Re: Split Square Into Smaller Squares - by NaS - 03.02.2018, 17:26

Forum Jump:


Users browsing this thread: 1 Guest(s)