diff --git a/src/public-async.js b/src/public-async.js index 2267af9..c8c0656 100644 --- a/src/public-async.js +++ b/src/public-async.js @@ -232,4 +232,19 @@ } + + /** + * Waits for the user to press a key to continue. + * + * @returns {Promise} Resolves when the user presses a key. + */ + beep8.Async.waitForContinue = async function() { + + while ( true ) { + const key = await beep8.Async.key(); + if ( key.includes( "Enter" ) || key.includes( "ButtonA" ) ) break; + } + + } + } )( beep8 || ( beep8 = {} ) ); diff --git a/src/public.js b/src/public.js index 6c88fe5..71c7552 100644 --- a/src/public.js +++ b/src/public.js @@ -211,6 +211,9 @@ * The text can contain embedded newlines and they will behave as expected: * printing will continue at the next line. * + * Fonts use the defined tile size as their dimensions. Each character will + * be one tile. By default the tile size is: 12x12 pixels. + * * If PRINT_ESCAPE_START and PRINT_ESCAPE_END are defined in CONFIG, then * you can also use escape sequences. For example: * - {{c1}} sets the color to 1 @@ -248,7 +251,7 @@ /** * Prints text centered horizontally in a field of the given width. * - * If the text is bigger than the width, it will overflow it. + * If the text is bigger than the width, it will wrap. * * @param {string} text - The text to print. * @param {number} width - The width of the field, in characters.