view.entity-module.textUtils.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of module-entities Show documentation
Show all versions of module-entities Show documentation
Entity Manager module for the CodinGame engine toolkit. Simplify the management of shapes and drawings.
export function ellipsis (text, maxWidth) {
if (text.width > maxWidth) {
while (text.text.length > 3 && text.width > maxWidth) {
text.text = text.text.slice(0, -4) + '...'
}
}
}