HTML tuval moveTo() Yöntemi

❮ HTML Kanvas Referansı

Örnek

Bir yola başlayın, 0,0 konumuna gidin. 300.150 konumu için bir çizgi oluşturun:

TarayıcınızHTML5tuval etiketini desteklemiyor.

JavaScript:

var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.beginPath();
ctx.moveTo(0, 0);
ctx.lineTo(300, 150);
ctx.stroke();

Tarayıcı Desteği

Tablodaki sayılar, yöntemi tam olarak destekleyen ilk tarayıcı sürümünü belirtir.

Method
moveTo() Yes 9.0 Yes Yes Yes

Tanım ve Kullanım

moveTo() yöntemi, yolu bir çizgi oluşturmadan tuvalde belirtilen noktaya taşır.

İpucu: Yolu tuvale gerçekten çizmek için vuruş() yöntemini kullanın .

JavaScript sözdizimi: bağlam .moveTo( x,y );

Parametre Değerleri

Parameter Description Play it
x The x-coordinate of where to move the path to
y The y-coordinate of where to move the path to

❮ HTML Kanvas Referansı