Getting Started with Processing 第二,三章总结

第一章是文化熏陶。

第二章:开始编程

菜单栏中的 Show 的快捷键

Run:进行显示
shortcut:可以通过快捷键 cmd + R 执行
Present:进行全屏的显示
shortcut:可以通过按下 Shift 的同时,按住菜单栏运行按钮进行。

案例(Examples)和引用(Reference)

在 Processing 中,有很多案例可以学习,同时,也可以通过点击 File>Examples>Add Examples 来添加案例。
如果有什么地方不太清楚,可以请教 Reference ,右键点击关键字,然后选择 find in Reference。

第三章:画图

运行窗口 :size()函数

默认的窗口大小为:100x100

  • 如果正常大小,应该写为size(x,y);
  • 如果比屏幕大,那么只显示屏幕范围
  • 如果比100x100小,窗口大小仍然为 100x100,但画布比100x100小。

画图:基本形状

在 Processing 中,可以通过两种方法画图:一种是输入每一个点的坐标,然后连接起来:常见于线,三角形;另外一种是确定中心的位置或者边角的位置,然后确定其尺寸:常见于圆,矩形。

第一种画法:输入每一个点的坐标(x,y)

•点:point(x,y);
•三角形:triangle(x1,y1,x2,y2,x3,y3);
•四边形:quad(x1,y1,x2,y2,x3,y3,x4,y4);
•自定义图形,beginShape()用于花画一个新的图形,步骤如下:

  1. 先调用beginShape()
  2. 然后用vertex(x,y);输入每一个坐标的值
  3. 最后用endShape(),结束,如果想要闭合图形,那么就用 CLOSE 参数。

第二种画法:通过先确定中心或者边角的位置

•rect(x,y,width,heighth);
ellipse(x,y,width,heighth);

画图:形状属性

  • 描边粗细:strokeWeight();
  • 端点样式:默认状态下,端点为 ROUND,其他可选参数为:SQUARE,PROJECT.
  • 线段转折样式:默认状态下,转折样式为 MITER(斜接),其他可选参数为:BEVElL,ROUND

画图:颜色

可以通过三个函数改变颜色:

  1. 改变背景的颜色 background()
  2. 改变图形的颜色 fill() 无填充为noFill()
  3. 改变描边的颜色 stroke 无描边为noSroke()

而且也有几种设置颜色的方法:

  1. 灰色:通过灰度值0~255设置颜色,函数内只需要一个数字。
  2. 彩色:通过 RGB 设置颜色,函数内需要三个数字。也可以采用 Tool>Color Selctor 中选择颜色来设置。
    透明度可选,为第四个参数。





转载于:https://www.cnblogs.com/FBsharl/p/10054247.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Getting Started with Angular - Second Edition by Minko Gechev English | 6 Apr. 2017 | ISBN: 1787125270 | 308 Pages | EPUB/PDF (conv) | 7.7 MB Key Features Get up to date with the final changes to Angular 2, including the improvements to directives, change detection, dependency injection, router, and more Understand Angular 2's new component-based architecture Start using TypeScript to supercharge your Angular 2 applications Book Description Angular is the modern framework you need to build performant and robust web applications. This book is the quickest way to get to grips with Angular 2 and will help you transition to the brave new world of Angular 2. It starts with an overview putting the changes of the framework in context with version 1.x. After that, you will be taken on a TypeScript crash-course so you can take advantage of Angular 2 in its native, statically-typed environment. We'll look at the new change-detection method in detail, how Directives and Components have changed how you create websites with Angular, the new Angular 2 router, and much more. By the end of the book, you'll be ready to start building quick and efficient Angular 2 applications that take advantage of all the new features on offer. What you will learn Understand the changes made from Angular 1.x with side-by-side code samples to help demystify the Angular 2 learning curve Start working with Angular 2's new method of implementing directives Use TypeScript to write modern, powerful Angular 2 applications Dig in to the change-detection method, and other architectural changes to make sure you know what's going on under the hood of Angular 2 Get to work with the new router in Angular 2 Use the new features of Angular 2 including pipes, or the updated features such as forms, services, and the DI module Master server-side rendering in Angular 2 to keep your new applications SEO-friendly

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值