"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.measureString = exports.measureStringWidthNoConvert = exports.stringToArray = void 0;
const __1 = require("..");
const Math_1 = require("./Math");
function stringToArray(input) {
    let stringsNeeded = 1;
    if (input.length > 99) {
        stringsNeeded = Math.ceil(input.length / 99);
    }
    const outputString = new Array(stringsNeeded);
    for (let i = 0; i < stringsNeeded; i++) {
        outputString[i] = input.substring(i * 99, i * 99 + (0, Math_1.clamp)(input.substring(i * 99).length, 0, 99));
    }
    return outputString;
}
exports.stringToArray = stringToArray;
function measureStringWidthNoConvert(input, font = __1.Font.ChaletLondon, scale = 0) {
    SetTextEntryForWidth('STRING');
    __1.Text.addLongString(input);
    SetTextFont(font);
    SetTextScale(1, scale);
    return GetTextScreenWidth(false);
}
exports.measureStringWidthNoConvert = measureStringWidthNoConvert;
function measureString(str, font, scale, screenWidth = __1.Screen.ScaledWidth) {
    return this.measureStringWidthNoConvert(str, font, scale) * screenWidth;
}
exports.measureString = measureString;
