32
Processing Hello World & Variable & Setup 01 HELLO世界 & 變數 & 設定

Processing=001=helloworld&variables

Embed Size (px)

DESCRIPTION

A_Little_Bit_Processing_Tutorial

Citation preview

Page 1: Processing=001=helloworld&variables

Processing

Hello World & Variable& Setup

01HELLO世界&變數

&設定

Page 2: Processing=001=helloworld&variables

Now We Code it.終於可以寫程式了^_^

Page 3: Processing=001=helloworld&variables

print (“Hello World !!!”);open close

stringFunction

END

Remember to end with “;”記得結尾要 “;”

Page 4: Processing=001=helloworld&variables

Type what I tell you in this AREAThen press “play” (compile) to “RUN” the code

1

2

在空白處打上字然後按RUN

Page 5: Processing=001=helloworld&variables

You will see that what you type, is coming right here!This is your “FIRST CODE!”

3

下面就會出現結果

Page 6: Processing=001=helloworld&variables

Print (“Hello Kitty !!!”);open close

stringFunction

END

Page 7: Processing=001=helloworld&variables

VARIABLE參數

Page 8: Processing=001=helloworld&variables

int(integer)

float(floating numbers)

string

boolean

NAME

1,2,3,4,5…99,1304

EXAMPLE

0.5, 2.78, 3.1415….

HappyBody

True or False

整數

小數

字串

布林

Page 9: Processing=001=helloworld&variables

Declare the VariablesLet computer knows who you are

int x;

float y; this is “y” and it is a floating number

this is “x” and it is an integer

宣告參數

這是 x 它是一個整數

這是 y 它是一個帶小數的數字

Page 10: Processing=001=helloworld&variables

int x;x=100;

float y = 20.845;

println(x); println(y); println(“x+y=” + x+y);

Declare the Variables

write it in 2 lines.

write it in 1 lines.

寫成兩行

寫成一行

Page 11: Processing=001=helloworld&variables

CODE

RESULT

RESULT

Page 12: Processing=001=helloworld&variables

STOP CACULATE PLEASE!!!!!!!!!!!

我不要算拉!!!

Page 13: Processing=001=helloworld&variables

SET UP設定

Page 14: Processing=001=helloworld&variables

void setup(){//basic setup, run once}

void draw(){//draw something, run as loop}

基本設定 跑一次

捉傷心(畫東西) 跑跑跑一直跑

Page 15: Processing=001=helloworld&variables

ellipse (locX, loxY, Xr, Yr);open close

stringFunction

END

Page 16: Processing=001=helloworld&variables

200

20

0

0 500

50

0

50

Page 17: Processing=001=helloworld&variables
Page 18: Processing=001=helloworld&variables
Page 19: Processing=001=helloworld&variables
Page 20: Processing=001=helloworld&variables
Page 21: Processing=001=helloworld&variables

Are you Bored?無聊否?

Page 22: Processing=001=helloworld&variables
Page 23: Processing=001=helloworld&variables
Page 24: Processing=001=helloworld&variables

Fill color

填色

Page 25: Processing=001=helloworld&variables
Page 26: Processing=001=helloworld&variables
Page 27: Processing=001=helloworld&variables

Background

refresh

If you put

this in draw

背景刷新如果你把此放在draw

Page 28: Processing=001=helloworld&variables

1

2

3

4

Page 29: Processing=001=helloworld&variables
Page 30: Processing=001=helloworld&variables
Page 31: Processing=001=helloworld&variables

void setup(){

size(500,500);

smooth();

}

void draw(){

fill(mouseX-245, mouseY-245,

(mouseX+mouseY)/10);

ellipse(250,250,mouseX,mouseY);

}

Page 32: Processing=001=helloworld&variables

Reference