You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a function that adds an ellipsis (...) at the end of my canvas text. I was wondering, how would one go about adding that function to your script? Any advice would be much appreciated!
function ellipsis1(context,text1) {
var words = text1.split();
var dot = '...';
var more2 = '';
var maxWidth = 115;
var x = 48;
var y = 28;
for(var n = 0; n < words.length; n++) {
var metrics = context.measureText(words);
var textWidth = metrics.width;
if (textWidth > maxWidth) {
more2 = words + dot;
}
}
context.fillText(more2, x, y);
}
The text was updated successfully, but these errors were encountered:
hello,
I have a function that adds an ellipsis (...) at the end of my canvas text. I was wondering, how would one go about adding that function to your script? Any advice would be much appreciated!
function ellipsis1(context,text1) {
var words = text1.split();
var dot = '...';
var more2 = '';
var maxWidth = 115;
var x = 48;
var y = 28;
The text was updated successfully, but these errors were encountered: