わたしにも一言いわせて
Codea について

いいページがあったので


http://qiita.com/tkyaji/items/674a94d1ad5aaf3cec6e#%E3%81%8A%E3%82%8F%E3%82%8A%E3%81%AB


https://processing.org/reference/pushStyle_.html


http://twolivesleft.com/Codea/Reference/index.html


結局、pushStyle() と、popStyle() は対になっている事が
望ましいが、関数の終わりの. -- 書きかけ

popStyle() は、省略される事がある。

これは、もちろん推奨されるべきでは無い。

前参照ページの『物理エンジン(Physics)』が、
これにあたる。 -- よく分からん。

真ん中のページの 例では

strokeWidth(5) --strokeWeight(5)

と書かないと -- 書きかけ
いけないみたいです。Codea では、

strokeWeight では stroke() 関数のパラメータを
受け取れないみたいです。 -- 書きかけ

strokeWeight() 関数は、無いのかな???






真ん中のページを Codea で書くと



-- ref 9

xOffset1 = 100
yOffset1 = 100
xOffset2 = 100
yOffset2 = 50

-- Use this function to perform your initial setup
function setup()
print("Hello World!")
end

-- This function gets called once every frame
function draw()
-- This sets a dark background color
background(40, 40, 50)

-- This sets the line thickness
-- strokeWidth(5)
pushStyle()

-- Do your drawing here

ellipse(0+xOffset1, 50+yOffset1, 33, 33) -- Left circle

pushStyle() -- Start a new style
strokeWidth(5) --strokeWeight=10
fill(204, 153, 0)
ellipse(50+xOffset1, 50+yOffset1, 33, 33) -- Middle circle
popStyle() -- Restore original style

ellipse(100+xOffset1, 50+yOffset1, 33, 33) -- Right circle

--[[ ]]--

ellipse(0+xOffset2, 50+yOffset2, 33, 33) -- Left circle

pushStyle() -- Start a new style
--strokeWeight(5)
strokeWidth(5) --strokeWeight=10
fill(204, 153, 0)
ellipse(33+xOffset2, 50+yOffset2, 33, 33) -- Left-middle circle

pushStyle() -- Start another new style
stroke(0, 102, 153)
ellipse(66+xOffset2, 50+yOffset2, 33, 33) -- Right-middle circle
popStyle() -- Restore the previous style

popStyle() -- Restore original style

ellipse(100+xOffset2, 50+yOffset2, 33, 33) -- Right circle

popStyle()
end

2016 09/18 20:45:08 | none | Comment(0)
Powerd by バンコム ブログ バニー

この記事へのコメント

この記事にコメントする

名前:
メールアドレス:
URL:
セキュリティコード  
※セキュリティコードとは不正アクセスを防ぐためのものです。
画像を読み取り、入力して下さい。

コメント:
タグ挿入

サイズ
タグ一覧
Smile挿入 Smile一覧