p5js/sketch-template.js

28 lines
604 B
JavaScript
Raw Normal View History

2022-12-11 13:52:13 +00:00
function setup() {
createCanvas(600, 600);
2022-12-11 14:04:43 +00:00
angleMode(DEGREES);
cursor(CROSS);
frameRate(60);
2022-12-11 13:52:13 +00:00
}
function draw() {
background(64);
}
function drawGrid() {
push();
stroke(0, 64);
strokeWeight(1);
for (let x = 0; x < width; x += 10) line(x, 0, x, height);
for (let y = 0; y < height; y += 10) line(0, y, width, y);
pop();
}
2022-12-11 15:34:40 +00:00
function textInfo() {
noStroke();
fill(0);
text("作品:太阳公公", 30, height - 70);
text("作者:赵海洋爸爸", 30, height - 50);
text("日期2022/12/11", 30, height - 30);
}