[[ƦץȤγ>SoraMame.ps.js]]Syntax & Style

#title(ʸˡȽ - ܸäݤץߥ󥰸 Ʀץ)

ߤΤƦץ(SoraMame.ps.js)ϡץProcessing.jsѴƼ¹Ԥޤ

#contents

''[[ޥɥե:https://github.com/ycatch/SoraMame.ps.js/wiki]]''ϡˤޤ

*ʵǽ [#i25dde6c]

-Web֥饦ưӥ奢ǥѤΥץߥ󥰸
-Ф䤹ñʸˡ
-֥Ȼظ򥵥ݡ
-WebGLˤ3Dɽ

*ʸμ [#o35dd873]

ƦץȤǤϡɤ񤯤ʸ򼡤Τ褦ʬषƤޤ

** [#u3a8caf6]

ʲʸϡȤ̰ޤ

 ȡˡ򡢤Ρ
 

Ȥˡ֤ϡפϥǡ˻Ȥޤ


ʸϡѿ̾ؿ̾˻ѤǤޤ

** [#b4101ac8]

֡(-)ϡ֥ȤΥ᥽åɸƤӽФ˻Ȥޤ

** [#ubb72e2b]

***10ɽ [#d01fc0f3]

 124 , 3.14 , -2.3

-Ⱦѿ
-ѿ
-"."""Ǿʲɽޤ

***16ɽ [#r281f0ae]

顼Υǡʤɤ16ɽǵҤǤޤ

 #FF00 , #2234

-Ƭϡ#
-ͤϡ0-9, a-f, A-F
-٤Ⱦ

** [#wfe44cfc]

εϡƦץȤ̤äƤޤ

 = + - * / % ^ ( ) [ ] { } . , : @ ! & | < > #
                         ֡סء 

ʳεϡդĤʸȤƼͳѤǤޤ

֡(-)ϡ̤ʵȤưäƤޤ

**ʸ [#df74be83]

ʸ(⤸)ȤϡץʸˤǡΤȤǤ

ʸϡΣĤΤɤ餫ΥåΥڥǡϤߤޤ

-  
-  

*Ūʤ [#x7a0565f]

**ʸ [#za44d8e4]

ʸϡΤɤ餫ȽǤޤ

- 
- ʶ

**դȸդζڤ [#r0af330a]

ܸǤϡۤȤɤξ硢դȸդδ֤˶򤪤ޤ

ΤˡץȤƸդȽ̤񤷤ʤäƤޤ

ǡƦץȤǤϡʸθդζڤ

ֽסֿסֵסʸפȽ̤ޤ


**ѿ̾̿̾(ؿ᥽å)˻Ȥʸ [#r4fe7289]

ʸȾʸΤۤȤɡ

ʲΤޤ

-
-
-ȤϿѤߤѿ̾ȴؿ̾
-(1ʸܤΤ)

ȤˡǽΣʸ˿ϻȤޤ


*ʸˡ - ǡ [#t0cbd238]

**ѿ̾ [#t90dbc9c]

ѿϡ̾'@'򵭽Ҥޤ

 @ޥX
 @
 @

@ΤȤˤϡܸѸ򤽤Τޤ޻Ȥޤ2ʸܰʹߤˤϿȤޤ

**ȥ [#c785989b]

ͤѲʤǡϡˤޤޤƥǻ꤬ɬפñϡɤȤʤޤ

ȥɤϡ̾'$'򵭽Ҥޤ

 $P3D
 $PI

@ΤȤˤϡܸѸ򤽤Τޤ޻Ȥޤ2ʸܰʹߤˤϿȤޤ

**ǡ [#dde290e1]

ѿ̾ΤȤˤϡΤ褦˽()ǡǡǤޤ

 @
 @åʸ

ѿ̾Υǡꤷľˡͤ뤳ȤǤޤ

 @ = 0
 @åʸ =֤

**ܥǡ [#o7821aa7]

ΥǡϡܥǡȤƥǡʤѤǤޤ

 
 ¿
 ʸ
 ݷ
 顼

**Ȥ߹ߥǡ [#x2f97ca5]


Ȥ߹ߥǡפȤϡ٤ʵǽäǡǡܥǡȾȤ㤤ޤ

Ȥ߹ߥǡפϡҤȤĤΥǡʣͤޤȤ᤿ꡢͤФ̤ʵǽ(᥽å)Ƥޤ(֥ȻظȤ߹ߥ֥Ȥޤ)

Τ褦ʥǡȤˤϡѿ̾ΤȤˤϡΤ褦˽()ǡǡޤ
ϡۤɤƱ

 @vP٥ȥ뷿

ѿ̾ˡͤϤˤϡΤ褦ˡֿ̿Ȥޤ

 @vP٥ȥ뷿
 @v = {x:10, y:20, z:40}P٥ȥ뷿

ϡΤ褦ˤҤȤĤˤޤȤ뤳ȤǤޤ

 @vP٥ȥ뷿 = {x:10, y:20, z:40}P٥ȥ뷿

ġͤϡΤ褦ˤѤǤޤ

 @v@x = 100

ޤǡФ̤ϡΤ褦˸ƤӽФޤ

 @v{x:100, y:200, z:400}ꤹ
 @v{x:100, y:200, z:400}ꤹ


** [#n27270a3]

ϡʣΥǡֹĤưǽǤ

Τ褦ˡҤޤ

 @ץ쥤䡼[1] = 7
 @ץ쥤䡼[2] = 34
 @ץ쥤䡼[3] = 240

ȤˤϡΤ褦ޤ

 @(̾)(ǡ)[]

餫θĿˤϡΤ褦˽񤭤ޤ

 @(̾)(ǡ)[] = (ǡ)[(Ŀ)]

ä̤ʽǤۤɤȤ߹ߥǡ䡢ȤǽФƤȼǡƱˤʤäƤޤ

*ʸˡ -  [#c489f66e]

Ȥꤢ(P)Ȥޤ

ܤϡ[[SoraMame.ps.js/Reference]]Ρֻѵסӵס黻פ򻲾Ȥ

*ʸˡ - ʸ [#w8fe0eb3]

**ʸ [#bf8e2a82]

Ƭޤʸˡ//פ񤯤ȡʹߤϥʸˤʤꡢץμ¹Ի̵뤵ޤ

 //ʹߤϡʸ

֥åȤϡ档

**¹ʸ [#u4f227ad]

¹ʸϡ¤Ӥ³ơ̿򤪤ޤ

 
 {:250, ⤵:250}Υ
 {x:ޥX, y:ޥY}{:10, ⤵:10}Υޥ

̿ˤΤϡ֥ס֥ޥפǤ

** [#i0ecfd6a]

ϡְ̾פȡ͡פΣĤȤ߹碌{}פǰϤǡǤĤʤޤ

-{̾:,}
-ΣĤνʤȡˡ򡢤Ρǡ

ϡҤ֤(¤)¸ޤ

̾Ƚμࡦ֤ϡ̵뤵ޤ

ۤɤǡˤΤ

 {:250, ⤵:250}

 {x:ޥX, y:ޥY}{:10, ⤵:10}

Ǥ


**ʸ [#ude26feb]

Τ褦˵Ҥơѿˡͤޤ

 () = ()

 @ = 0

ˤϼ()ѤǤޤ

 @ = 3 + 2

ǡΤȤ褦ˡǡ³ơͤ뤳ȤǤޤ

 @ = 0
 @åʸ =֤

Ȥ߹ߥǡΤȤ褦ˡֿ̿ȥåȤǻȤȤǤޤ

 @vP٥ȥ뷿 = {x:10, y:20, z:40}P٥ȥ뷿

ޤ黻ҤȤޤ

 @ += 10

ܤϡ[[SoraMame.ps.js/Reference]]Ρפ򻲾Ȥ


**⤷ʸ [#e6a199fb]

2Ĥνޤ

 ⤷{:P}ʤ
    {//¹}

 ⤷{:P}ʤ
    {//¹}
 
    {//¹}

PˤĤƤϡ[[SoraMame.ps.js/Reference]]Ρӵס黻פ򻲾Ȥ


**֤ʸ [#s4c64c94]

ꤷͤꤷޤǡ򤯤֤ޤ

Τ褦˽񤭤ޤ

 {:@i = 0 , :@i < 100 ,Ѳ:@i += 1}Τ꤫{
 {x:@i, y:@i}{:30, ⤵:30}Υޥ
 }

**ʸ [#c65950af]

ξδ֡򤯤֤ޤ

Τ褦˽񤭤ޤ

 @y = 0
  {:@y < @⤵}Τ{
 {x:50, y:@y}{:30, ⤵:30}Υޥ
 @y += 20
 }

*ʬʤ̿ɲä [#o1be27f7]

ʬʤ̿Ƥȡۤξ꤫鼫ͳ˸ƤӽФȤǤޤ

νޤȤƤꡢץʬ䤹뤿˻Ȥޤ


**̿ [#oa4acea5]

̿ȡؿ᥽åɤȤѤǤޤ

ޤֽꤹפ֤֤褹פΤ褦ˡ餫줿̿ץȡץμ¹ԴĶƤӽФ⤢ޤ

̿ˤϡ4νޤ

 ---(̿̾){//¹}

 ---(̿̾)(ͥǡ){//¹}

 ---{̾1:1, ...}(){̾2:2, ...}()(̿̾){//¹}

 ---{̾1:1, ...}(){̾2:2, ...}()(̿̾)(ǡ){//¹}

Ǹ(ͥǡ)ꤷƤϡͤΥǡꤷޤ

ͤʤξϾάޤ(void)

ʲץ

 ---¹Ԥ{
   //¹
 }

 ---¹Ԥ{
   //¹
   {:100}Ǥɤ
 }

 ---{:@x}Ǽ¹Ԥ{
   //¹
 }

 ---{:@x}Ǽ¹Ԥϼ¿{
   //¹
   {:10.2}Ǥɤ
 }


*(饹) [#kced5ffa]

ַפϡʬʤΥǡ뵡ǽǤҤȤĤηʣΥǡޤȤ᤿ꡢǡ̿Ȥ߹碌ƤȤǤޤϡǡƱ褦˻ȤȤǤޤ


** [#gea86f21]

Τ褦˽񤭤ޤ

 ===(̾) {
   //˷
   (ĥǡ)
 +++(̿){
   }
 ---(ȼ̿){
   }
 }

̿ϡηäǡȤǽ˸ƤӽФ̿Ǥ̾Ʊ̾ˤޤǤͤϾάޤ

ȼ̿ϡΥǡ̿Ǥ(֥ȻظΥ᥽åɤˤޤ)ۤȼ̿ȽƱǤ

** [#wf1c3700]

Ѥˤϡޤѿޤ줫ֿ̿Ȥä˸ƤӽФơѿޤΤȤꤷƽͤǤޤ̿ȷ̾Ʊ̾ˤʤäƤޤ

 @(ѿ̾)(̾)
 @(ѿ̾)=(̿)#ֿפȤޤ


ȼ̿ƤӽФˤϡΤ褦ˤޤ

 @(ѿ̾)(ȼ̿)
 @(ѿ̾)()(ȼ̿)

ȼǡƤӽФˤϡΤ褦ˤޤ

 @(ѿ̾)@(ȼǡ)

*Processing.jsΥ᥽åɤץѥƥɲäˡ [#da74414f]

Ʀץ(soramame.ps.js)ϡܸäݤɤProcessing.jsΥɤѴƼ¹Ԥޤ~
ƦץȤ̿ĶѿProcessing.jsΤɤΥ᥽åɤץѥƥбդ뤫ϡ餫ꤷƤޤ~
ɲä뤳Ȥǡ̿ѿ򥵥ݡȤǤޤ

**ե [#ee4a55fd]

ɲäˤϡlib_command.jsץեԽޤ~
ϡlib_command.jsפΰǤ

 //Ѵǡ - ̿
 //ǡ  Ѵǡ
   this.commands = {
     //Structure
      : 'size',
     ꤹ : 'setup',
     ֤褹 : 'draw',
     ɤ : 'return',

ΥեˡΤ褦ʷǡѴñ(Ʀ)Ѵñ(Processing)бդޤ~
Ρ,()˺ʤ褦ˤޤ礦

     (Ʀ) : '(Processing)',

**եѹˤ뤳 [#k2f3cc4c]

Υե񤭴顢Web֥饦ɤ


**ե [#id28b1e5]

lib_command.jsפˤϡ4Ĥμ򵭽ҤǤޤ

***̿ [#z4837f1c]

̿᥽åɤѴޤ~
ĤȤǤޤ

-㡧 ƥ : 'point',
-㡧 : 'line',

***Ķѿ [#w2e88719]

Ķѿ̾Ѵޤ~

ƦץȤΥǵҤȤˤϡ
ĶѿˤƬˡ@פդޤ

-㡧  : 'width',
-㡧 ⤵ : 'height',
-㡧 ޥX : 'mouseX',
-㡧 ޥY : 'mouseY',

ˤƬˡ$פդޤ

-㡧 PI : 'PI',
-㡧 HALF_PI : 'HALF_PI',


***ǡ̾(ܥǡȤ߹ߥǡ) [#j01e7297]

ǡ̾䥯饹̾Ѵޤ~
ƦץȤΥǵҤȤˤϡ~
ѿ̾(ǡ̾)פȵҤޤ

-㡧  : 'int',
-㡧 ¿ : 'float',
-㡧 P᡼ : 'PImage',
-㡧 P٥ȥ뷿 : 'PVector',
-㡧 Pեȷ : 'PFont',


***ץѥƥ̾᥽å̾ [#x3647f41]

Υ饹°ץѥƥ̾᥽å̾Ѵޤ~
Ʀץ¦ϡ°륯饹̾(Ѵ)ȡץѥƥ̾᥽å̾(Ѵ)~
"_"(С)ǤĤʤޤ

-㡧 PVector_x : 'x',
-㡧 PVector_y : 'y',
-㡧 PVector_z : 'z',
-㡧 PVector_ : 'get',
-㡧 PVector_ꤹ : 'set',


*˾ܤ [#i8509b24]

ƦץȤϡCJavaRubyȤäڤƤALGOLϥץߥ󥰸Ʊ褦ʸˡƤޤ

ȤˡŪʹͤϡJavaˤ褯Ƥޤ

Ȥ桼Processing/Processing.jsѴƤʤΤǡʸˡȤۤƱǤ

-[[Processing.jsú®]]
-[[Processingú®]]

ȥå   ʬ Хåå   ñ측 ǽ   إ   ǽRSS