HTML canvas moveTo() နည်းလမ်း
ဥပမာ
လမ်းကြောင်းတစ်ခုစတင်ပါ၊ အနေအထား 0.0 သို့ရွှေ့ပါ။ 300,150 အနေအထားသို့ လိုင်းတစ်ခုဖန်တီးပါ
JavaScript-
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.beginPath();
ctx.moveTo(0, 0);
ctx.lineTo(300, 150);
ctx.stroke();
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် နည်းလမ်းကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။
Method | |||||
---|---|---|---|---|---|
moveTo() | Yes | 9.0 | Yes | Yes | Yes |
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
moveTo() နည်းလမ်းသည် မျဉ်းမဖန်တီးဘဲ ကင်းဗတ်ရှိ သတ်မှတ်ထားသော အမှတ်သို့ လမ်းကြောင်းကို ရွှေ့သည်။
အကြံပြုချက်- ကင်းဗတ်စ်ပေါ်တွင် လမ်းကြောင်းအမှန်တကယ်ဆွဲရန် stroke() နည်းလမ်းကို အသုံးပြု ပါ။
JavaScript syntax- | စကား စပ် .moveTo( x,y ); |
---|
ကန့်သတ်တန်ဖိုးများ
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 Canvas အကိုးအကား