BLC 사용 예제 - 전광판 효과내며 출력하기
BLC 라이브러리 다운로드
문자열을 전광판 효과(흘러가는 문자열)를 내며 출력하는 예제 코드입니다.
예제 코드 보기
- #include
- #include
-
- #include
- #include
- #include
- #include
-
- int main()
- {
- using namespace blc::console;
- using namespace blc::ustr;
- using namespace std;
-
- SetCharacterWidthFunc(mk_wcwidth_cjk);
-
-
- ConsoleWindow::SetTitle(L"전광판 효과 예제"s);
-
- auto str = u8"흑이는 정말 귀여운 검은고양이 입니다. "s;
-
- cout << u8"전광판 효과(흘러가는 문자열)를 내면서 출력합니다."s << endl << endl;
-
-
- ConsoleWindow::CursorTypeManager no_cursor(ConsoleWindow::CursorType::kNoCursor);
-
- auto y_pos = ConsoleWindow::WhereY();
- while (true) {
- ConsoleWindow::GotoXY(0, y_pos);
- cout << str;
- str <<= 1;
- this_thread::sleep_for(100ms);
- }
-
- return 0;
- }
예제 코드 접기
실행 결과
