I would like to see that objects can be aligned to user-defined grid.
Not just positions, but also corners (pos + width, pos + height,...)
irrEdit feature request
uhh like what gui?
make a duel for loop for a grid
Then run it using
drawgrid();
after you draw the "scene" and before the gui.
ResX and ResY is equal to the screen resolution.
GridSize is the amount of spacing between lines if 10x10 GridSize equals 10.
To position gui on alignment simply set it's coordinates to the position of desired spacing... 10 20 30.
There is a lot of talk about gui alignment and resolution\scaling read more forum. try howto and snippets.. or the help section.
make a duel for loop for a grid
Code: Select all
void Guice::drawgrid()
{
if (grid == true)
{
s32 GresX = ResX / GridSize;
s32 GresY = ResY / GridSize;
for ( s32 x = 0; x < GresX; x++ )
{
driver->draw2DRectangle(SColor(255,90,90,90),rect<s32>(x*GridSize-1,0,x*GridSize,ResY));
// driver->draw2DLine(position2d<s32>(x*GridSize-1,0), position2d<s32>(x*GridSize,ResY),SColor(255,90,90,90));
}
for ( s32 y = 0; y < GresY; y++ )
{
driver->draw2DRectangle(SColor(255,90,90,90),rect<s32>(0,y*GridSize-1,ResX,y*GridSize));
// driver->draw2DLine(position2d<s32>(0,y*GridSize-1), position2d<s32>(ResX,y*GridSize),SColor(255,90,90,90));
}
}
}
drawgrid();
after you draw the "scene" and before the gui.
ResX and ResY is equal to the screen resolution.
GridSize is the amount of spacing between lines if 10x10 GridSize equals 10.
To position gui on alignment simply set it's coordinates to the position of desired spacing... 10 20 30.
There is a lot of talk about gui alignment and resolution\scaling read more forum. try howto and snippets.. or the help section.