I'm looking for a c++ command..
a command to let text fill in the console.
like its loading.. letter for letter...
i hope you understand what i mean :D
google-site-verification: googlebaca44933768a824.html
cConLog::cConLog() { AllocConsole(); SetConsoleTitle("LIFE-STYLE Console Log"); this->m_hConsoleHandle = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(this->m_hConsoleHandle,FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY); COORD size; size.X = 500; size.Y = 200; SetConsoleScreenBufferSize(this->m_hConsoleHandle,size); this->Write(true," _ ___ _____ _____ ____ _______ ___ _____ "); this->Write(true,"| | |_ _| ___| ____| / ___|_ _\\ \\ / / | | ____|"); this->Write(true,"| | | || |_ | _| ____\\___ \\ | | \\ V /| | | _| "); this->Write(true,"| |___ | || _| | |__|_____|__) || | | | | |___| |___ "); this->Write(true,"|_____|___|_| |_____| |____/ |_| |_| |_____|_____|\n"); this->Write(true,"==>> LIFE-STYLE Console Log\n"); } cConLog::~cConLog() { FreeConsole(); } void cConLog::Write(bool bFinishLine,const char *pszText,...) { char szBuffer[256] = {'\0'}; va_list vaParameters; va_start(vaParameters, pszText); vsprintf(szBuffer, pszText, vaParameters); va_end(vaParameters); if (bFinishLine) strcat(szBuffer,"\n"); WriteConsole(this->m_hConsoleHandle,szBuffer,lstrlenA(szBuffer),0,0); }
static int index = 0; const char *text = "Hello"; static float oldtime = m_pGlobals->curtime; if (oldtime + 1/*= 1 second*/ < m_pGlobals->curtime) { // Write your char here: text[index] index++; }
int main() { srand( (unsigned int) time( NULL ) ); const char* str = "omg it looks like i was typing this shit"; for( int i = 0; i < strlen(str); i++ ) { cout << str[i]; Sleep( (DWORD)( rand() % 200 ) ); } }
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, personalize advertising, and to analyze site activity. We may share certain information about our users with our advertising and analytics partners. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment