dimanche 24 octobre 2021

Is there a method to increase the gap between two lines in c++ ColorText function?

enter image description here

is there a method to increase the gap between these lines in c++?

I felt that all the text are too near to each other, I want to increase the gap between those lines.

original code:

void ColorText(int color)
{
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),color);
}

int main()
{
    ShowWindow(GetConsoleWindow(), SW_MAXIMIZE);
    system_boot();
    ColorText(1761); 
    userInput(); //ignore this, some code doing some other functional stuff

    return 0;
}

what I've tried:

int main()
{
    ShowWindow(GetConsoleWindow(), SW_MAXIMIZE);
    system_boot();
    ColorText(1761); //1999 //1770 //1777 //1725 //1765 //1761
    cout<<endl<<endl<<endl<<endl; //I applied endl here
    userInput();

    return 0;
}

However, it hasn't got me to the solution, I guess that changes should be made at the SetConsoleTextAttribute in ColorText function , but I can't find any related documentation on that, so I seek help from here.

Best i can think of is I can directly add endl to those printed text, but it is very lengthy and inefficient, and also adding an endl will just print out another empty line only, like below enter image description here

It wasn't my initial motive, which is just increase / widen the gap and space of a particular line

Aucun commentaire:

Enregistrer un commentaire