【Processing学习】Project1

void setup()
{
  size(200,200);//Get the length of the list,画布大小吧
  noStroke(); //Disables drawing the stroke (outline). If both noStroke() and noFill() are called, nothing will be drawn to the screen.轮廓

  background(255);//255,255,255

/*

Syntax
background(rgb)
background(rgb, alpha)
background(gray)
background(gray, alpha)
background(v1, v2, v3)
background(v1, v2, v3, alpha)
background(image)

 */

 fill(0,102,153,204);//填充

  smooth();//Draws all geometry with smooth (anti-aliased) edges. smooth() will also improve image quality of resized images. Note that smooth() is active by default; noSmooth() can be used to disable smoothing of geometry, images, and fonts.
  noLoop();//Stops Processing from continuously executing the code within draw(). If loop() is called, the code indraw() begins to run continuously again. If using noLoop() in setup(), it should be the last line inside the block.
}


void draw()
{
  circles(40,80);
  circles(90,70);
}


void circles(int x,int y)//跟C一样的套路
{
  ellipse(x,y,50,50);
  ellipse(x+20,y+20,60,60);

}





void setup()
{
  size(200,200);
  rectMode(CENTER);
  noStroke();
  fill(0,102,153,204);
}
void draw()
{
  background(255);
  rect(width-mouseX,height-mouseY,50,50);//鼠标坐标
  rect(mouseX,mouseY,50,50);
}




posted @   PORTB  阅读(110)  评论(0编辑  收藏  举报
编辑推荐:
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 上周热点回顾(3.3-3.9)
· AI 智能体引爆开源社区「GitHub 热点速览」
点击右上角即可分享
微信分享提示