xxxxxxxxxx
22
let txt = "こんにちは!p5.jsは、アーティスト、デザイナー、教育者、初心者がコーディングにアクセスできるようにすることを目的としたProcessingの本来の目的から始まるJavaScriptライブラリです。これを今日のWeb用に再解釈します。"
//let txt = "To get started, download the project. This project includes all of the tracking.js examples, source code dependencies you'll need to get started.Unzip the project somewhere on your local drive. The package includes an initial version of the project you'll be working with. While you're working, you'll need a basic HTTP server to serve your pages. Test out the web server by loading the finished version of the project. For example: http://localhost:8000/tracking.js/";
var str1, str2, sliceStr;
var addBreakStr = "";
var wCount = 10;
function setup() {
createCanvas(400, 400);
sliceStr = txt;
for (var i = 0; i < txt.length / wCount; i++) {
str1 = sliceStr.slice(0, wCount);
str2 = sliceStr.slice(wCount);
addBreakStr += str1 + '\n';
sliceStr = str2;
}
}
function draw() {
background(200);
text(txt, 0, 0, 20, 200);
}