当前位置:网站首页>P5.js development - setting
P5.js development - setting
2022-07-03 19:49:00 【PGzxc】
One summary
- Background color related (background/clear/clolorMode)
- Fill in related (fill/noFill)
- Stroke correlation (stroke/noStroke)
- Erase canvas related (erase/noErase)
Two Background color related (background/clear/clolorMode)
2.1 Attribute specification
No | attribute | explain |
---|---|---|
1 | background | Background color |
2 | clear | Clear the pixels in the graphics buffer |
3 | colorMode | colorMode() change p5.js How to interpret color data |
2.2 Example
Code
let value=51;
function setup() {
background(value);
}
function mouseClicked()
{
clear();
colorMode(HSB, 100);
background('red');
}
design sketch
3、 ... and Fill in related (fill/noFill)
3.1 Attribute specification
No | attribute | explain |
---|---|---|
1 | fill | Fill color |
2 | noFill | Disable padding |
3.2 Example
Code
function setup() {
createCanvas(displayWidth, displayHeight);
fill(51);
rect(20, 20, 60, 60);
}
function mouseClicked()
{
noFill();
rect(30, 30, 80, 80);
}
design sketch
Four Stroke correlation (stroke/noStroke)
4.1 Attribute specification
No | attribute | explain |
---|---|---|
1 | stroke | Stroke |
2 | noStroke | Disable stroke |
4.2 Example
Code
function setup() {
createCanvas(displayWidth, displayHeight);
background(200);
}
function draw() {
strokeWeight(4);
stroke(51);
rect(20, 20, 60, 60);
}
function mouseClicked()
{
noStroke();
rect(80, 80,60, 60);
}
design sketch
5、 ... and Erase canvas related (erase/noErase)
5.1 Attribute specification
No | attribute | explain |
---|---|---|
1 | erase | Erase drawing |
2 | noErase | Cancel erase |
5.2 Example
Code
function setup() {
createCanvas(displayWidth, displayHeight);
background(200);
}
function draw() {
fill(250, 100, 100);
rect(20, 20, 60, 60);
erase();
}
function mouseClicked()
{
ellipse(25, 30, 30);
noErase();
}
design sketch
边栏推荐
- 2022-06-28 advanced network engineering (XIII) IS-IS route filtering, route summary, authentication, factors affecting the establishment of Isis neighbor relations, other commands and characteristics
- UE source code analysis: uccharactermovementcomponent - rootmotion
- Parental delegation mechanism
- FPGA learning notes: vivado 2019.1 project creation
- Xctf attack and defense world crypto master advanced area olddriver
- Zhang Fei hardware 90 day learning notes - personal record of day 3, please see my personal profile / homepage for the complete
- Bool blind note - score query
- Micro service knowledge sorting - three pieces of micro Service Technology
- Chapter 2: 4-digit Kaplan number, search even digit Kaplan number, search n-digit 2-segment sum square number, m-digit ingenious square number without 0, specify the number to form a 7-digit square nu
- Leetcode 1189. Maximum number of balloons (special character count)
猜你喜欢
2022-06-25 advanced network engineering (XI) IS-IS synchronization process of three tables (neighbor table, routing table, link state database table), LSP, cSNP, psnp, LSP
第一章:喝汽水,阶梯电费计算,阶梯电费计算函数,个人所税,求解平方根不等式,简化求解平方根不等式,求解调和级数不等式,解不等式:d<1+1/2-1/3+1/4+1/5-1/6+..士1/n
Professional interpretation | how to become an SQL developer
第一章:求奇因数代数和,求同吗小数和s(d, n),简化同码小数和s(d, n),拓广同码小数和s(d, n)
Sentinel source code analysis part I sentinel overview
第二十章:y= sin(x)/x,漫步坐标系计算,y= sin(x)/x 带廓幅图形,奥运五环,小球滚动与弹跳,流水显示,矩形优化裁剪,r个皇后全控nxn棋盘
Detailed and not wordy. Share the win10 tutorial of computer reinstallation system
Geek Daily: the system of monitoring employees' turnover intention has been deeply convinced off the shelves; The meta universe app of wechat and QQ was actively removed from the shelves; IntelliJ pla
05 -- QT OpenGL draw cube uniform
PR 2021 quick start tutorial, how to create a new sequence and set parameters?
随机推荐
Basic principle of LSM tree
Cesiumjs 2022 ^ source code interpretation [7] - Analysis of the request and loading process of 3dfiles
2022 Xinjiang latest road transportation safety officer simulation examination questions and answers
Zhang Fei hardware 90 day learning notes - personal record on day 6. Please see my personal profile / homepage for the complete record
PR FAQ: how to set PR vertical screen sequence?
Point cloud data denoising
第一章: 舍罕王失算
Summary of learning materials and notes of Zhang Fei's actual combat electronics 1-31
CesiumJS 2022^ 源码解读[7] - 3DTiles 的请求、加载处理流程解析
Cross compile opencv with contrib
2022-06-30 网工进阶(十四)路由策略-匹配工具【ACL、IP-Prefix List】、策略工具【Filter-Policy】
第一章:求所有阶乘和数,大奖赛现场统分程序设计,三位阶乘和数,图形点扫描,递归求n的阶乘n!,求n的阶乘n!,舍罕王失算
第二章:求a,b的最大公约与最小公倍数经典求解,求a,b的最大公约与最小公倍数常规求解,求n个正整数的的最大公约与最小公倍数
BOC protected alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC supplied by Qiyu
Promethus
Professional interpretation | how to become an SQL developer
How to improve data security by renting servers in Hong Kong
Ae/pr/fcpx super visual effects plug-in package fxfactory
第一章:简化同码小数和s(d, n)
2022-06-30 advanced network engineering (XIV) routing strategy - matching tools [ACL, IP prefix list], policy tools [filter policy]