Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.
Original Source
Original title: How to prevent Cropped words when use .match & .join
Source forum path: Game Development Engines > RPG Maker Javascript Plugins > Learning Javascript
Summary
Hi I have a var with a huge string. Am try to make a max letter count for each line. Is work, but is cropped my word.
Archived First Post
Hi
I have a var with a huge string.
Am try to make a max letter count for each line.
Is work, but is cropped my word.
How i can prevent Cropped words ?
Like the red Arrow show..
Here how ma var are setup
I use this myvar=myvar.match(/.{1,40}/g).join(' \n ');
// The text string example in a var
var TempDesscr = 'this is a test with text.match, but is cropping';
// Now replace the same var with the '\n'for break line eatch 40 letters
TempDesscr=TempDesscr.match(/.{1,40}/g).join(' \n ');
// and show function for the text description in picture bitmap
$gameScreen.setDTextPicture('\\OW[6] ' + TempDesscr +' ', 36);
$gameScreen.setFont('GameFont');
$gameScreen.showPicture(894, '', 0, 660, 485, 100, 100, 255, 0);
Protected download
Tanks a lot for helping guys
Downloads / Referenced Files
Log in to download
Log in, then follow the RPG Maker Developers Group to see these download links.
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.