1.
void setup() {
size(800,300); 視窗大小
rect(100,100,50,20);矩形
}
void draw(){
rect(mouseX,mouseY, 50,20);滑鼠矩形
}
2.
void setup() {
size(800,300);視窗大小
for(int x=0; x<800;x+=16){ 720/45
for(int y=0;y<300;y+=30){ 300/10
rect(x,y,16,30);矩形大小
}
}
}
void draw(){
int nowX=mouseX/16*16 , nowY=mouseY/30*30; 座標位置
fill(0);填黑色
rect(nowX,nowY,16,30); 黑色方塊大小
}
size(800,300);
for(int x=0; x<800;x+=16){
for(int y=0;y<300;y+=30){
rect(x,y,16,30);
}
}
}
void draw(){
int nowX=mouseX/16*16 , nowY=mouseY/30*30;
if(mousePressed && mouseButton==LEFT){滑鼠左鍵填黑色
fill(0);
rect(nowX,nowY,16,30);
}else if(mousePressed && mouseButton==RIGHT){滑鼠右鍵填白色
fill(255);
rect(nowX,nowY,16,30);
}
}
4.
PImage img;
void setup(){
size(1000,500);視窗大小
img=loadImage("https://urlove.cc/uploads/1543193585-gDNIC.jpg");圖片位置
}
void draw(){
image(img,0,0,750,400);圖片大小
}
5.
PImage img;
void setup(){
size(1000,500);
img=loadImage("https://urlove.cc/uploads/1543193585-gDNIC.jpg");
}
void draw(){
image(img,mouseX,mouseY,200,200);很多個好痛
}
6.
PImage img;
void setup(){
size(1000,1000);
img=loadImage("1.jpg");
}
void draw(){
image(img,mouseX,mouseY,750,500);
}
7.
PImage imgBG;
int [][] table = new int [45][10];
void setup(){
size(711,377);
imgBG=loadImage("12.jpg");
}
void draw(){
background(imgBG);
int nowI=mouseX/16, nowJ=mouseY/30;
if(mousePressed && mouseButton==LEFT){
table[nowI][nowJ]=1;
}else if(mousePressed && mouseButton==RIGHT){
table[nowI][nowJ]=0;
}
for(int i=0;i<45;i++){
for(int j=0;j<10;j++){
fill(0);
if(table[i][j]==1) rect(i*16,j*30,16,30);
}
}
}
void setup() {
size(800,300);視窗大小
for(int x=0; x<800;x+=16){ 720/45
for(int y=0;y<300;y+=30){ 300/10
rect(x,y,16,30);矩形大小
}
}
}
void draw(){
int nowX=mouseX/16*16 , nowY=mouseY/30*30; 座標位置
fill(0);填黑色
rect(nowX,nowY,16,30); 黑色方塊大小
}
3.
void setup() {size(800,300);
for(int x=0; x<800;x+=16){
for(int y=0;y<300;y+=30){
rect(x,y,16,30);
}
}
}
void draw(){
int nowX=mouseX/16*16 , nowY=mouseY/30*30;
if(mousePressed && mouseButton==LEFT){滑鼠左鍵填黑色
fill(0);
rect(nowX,nowY,16,30);
}else if(mousePressed && mouseButton==RIGHT){滑鼠右鍵填白色
fill(255);
rect(nowX,nowY,16,30);
}
}
4.
PImage img;
void setup(){
size(1000,500);視窗大小
img=loadImage("https://urlove.cc/uploads/1543193585-gDNIC.jpg");圖片位置
}
void draw(){
image(img,0,0,750,400);圖片大小
}
5.
PImage img;
void setup(){
size(1000,500);
img=loadImage("https://urlove.cc/uploads/1543193585-gDNIC.jpg");
}
void draw(){
image(img,mouseX,mouseY,200,200);很多個好痛
}
6.
PImage img;
void setup(){
size(1000,1000);
img=loadImage("1.jpg");
}
void draw(){
image(img,mouseX,mouseY,750,500);
}
PImage imgBG;
int [][] table = new int [45][10];
void setup(){
size(711,377);
imgBG=loadImage("12.jpg");
}
void draw(){
background(imgBG);
int nowI=mouseX/16, nowJ=mouseY/30;
if(mousePressed && mouseButton==LEFT){
table[nowI][nowJ]=1;
}else if(mousePressed && mouseButton==RIGHT){
table[nowI][nowJ]=0;
}
for(int i=0;i<45;i++){
for(int j=0;j<10;j++){
fill(0);
if(table[i][j]==1) rect(i*16,j*30,16,30);
}
}
}







沒有留言:
張貼留言