引数を持つメソッドの例
forked from 引数を持つメソッドの例 (diff: 1)
ActionScript3 source code
/**
* Copyright lenonsun ( http://wonderfl.net/user/lenonsun )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/2LUt
*/
// 引数を持つメソッドの例
package
{
import frocessing.display.F5MovieClip2D;
/**
* メソッドを使って星を描く
*/
public class GraphicExample extends F5MovieClip2D
{
public function setup() : void
{
drawStar(100,150);
drawStar(200,250);
}
private function drawStar( x:Number, y:Number) : void
{
noFill();
beginShape();
vertex( x+30, y+10);
vertex( x+43, y+50);
vertex( x+10, y+23);
vertex( x+50, y+23);
vertex( x+17, y+50);
endShape(CLOSE);
}
}
}
