2012-08-09 130 views
0

我發現這個代碼在Canvas元素的圓弧上鍵入。我已經基本上將其修改爲我所需要的,但我不知道如何更改它的「起點」?更改畫布中圓圈的起點?

我有一個演示here

回答

0
circle = { 
    x: cnv.width/2, // x coordinate of center 
    y: cnv.height/2, // y coordinate of center 
    r: 150, 
    lw: 75 
}; 

例如,給下面給出將在畫布的原點繪製它

circle = { 
    x: 0, // x coordinate of center 
    y: 0, // y coordinate of center 
    r: 150, 
    lw: 75 
};