BLC 사용 예제 - 타이핑 효과내며 출력하기
BLC 라이브러리 다운로드
입력한 문자열을 타이핑 하듯이 출력하는 예제 코드입니다.
예제 코드 보기
- #include
- #include
- #include
- #include
-
- #include
- #include
- #include
- #include
-
- int main()
- {
- using namespace blc::console;
- using namespace blc::ustr;
- using namespace blc::han;
- using namespace std;
-
- SetCharacterWidthFunc(mk_wcwidth_cjk);
-
-
- ConsoleWindow::SetTitle(L"타이핑 효과내며 출력하기 예제"s);
-
- auto& tbl = JamoTable::GetCompatibilityTable();
- Mchar<encoding::UTF8> mch;
- auto str = u8""s;
- ConsoleWindow::Space space(0, 0, 60, 1);
-
- cout << u8"입력한 문자열을 타이핑 효과를 내면서 출력합니다."s << endl << endl;
- space.set_y(ConsoleWindow::WhereY());
-
- ConsoleWindow::ModifyStr(str, space);
- cout << endl << endl;
-
- str = NFD_kblv(str, tbl);
- u8string temp;
-
- auto y_pos = ConsoleWindow::WhereY();
-
- for (size_t i = 0; i < str.length();) {
- NextChar(str, mch, i);
- temp += mch;
- {
-
- ConsoleWindow::CursorTypeManager type(ConsoleWindow::CursorType::kNoCursor);
-
-
- ConsoleWindow::GotoXY(0, y_pos);
-
-
- cout << NFC_kblv(temp, tbl);
- }
- this_thread::sleep_for(100ms);
- }
- cout << endl << endl;
-
- return 0;
- }
예제 코드 접기
실행 결과
