processing入门(1)----简单图像绘制

发布时间:2024年01月11日

一、学习笔记

我整理了一份学习笔记,如下

https://zhuanlan.zhihu.com/p/79623053

https://zhuanlan.zhihu.com/p/78756118

二、下载地址

https://pan.baidu.com/s/1QNKI-n3Qc0YnmwNfS2NWNA?pwd=proc%E2%80%8B

密码:processing?

二、图形绘制

size(大小)
rect(x,y,高度,宽度)? ? //矩形
ellipse(x,y,高度,宽度) //圆形
line(x,y,x,y)? ? ? ? ? ? ? ? ? //线
background(背景色)? ? //背景
fill(填充颜色)
mouseX mouseY ? ? ? ?//变量,鼠标坐标
def draw()? ? ? ? ? ? ? ? ? //循环执行的代码
def setup()? ? ? ? ? ? ? ? ??//?执行一次的代码
key? ? ? ? ? ? ? ? ? ? ? ? ? ? ?//变量,存储最近按下的键
text()? ? ? ? ? ? ? ? ? ? ? ? ? //打字

三、最后

代码,粉丝懂得

def setup():
    size(800,800)
def draw():
    if mouseX>400:
        background(0)
        stroke(255)
        fill(0)
        arc(600,200,200,150,0,PI)
        arc(200,200,200,150,0,PI)
        fill(0)
        ellipse(400,500,100,100)
        fill(255)
        textSize(30)
        text('Z',350,450)
        textSize(40)
        text('Z',300,400)
        textSize(50)
        text('Z',250,350)
    else:
        background(255)
        strokeWeight(5)
        arc(600,220,200,150,PI,TWO_PI)
        arc(200,220,200,150,PI,TWO_PI)
        arc(400,450,400,350,0,PI)
        stroke(0)

效果图

文章来源:https://blog.csdn.net/tcw_py/article/details/135508265
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。