ตัวอย่าง แทคที่ใช้
ตัวอย่าง : วาดรูปทรงวงรี
var stage = new Kinetic.Stage({
container: 'container',
width: 578,
height: 200
});
var layer = new Kinetic.Layer();
var oval = new Kinetic.Ellipse({
x: stage.getWidth() / 2, // กำหนดแนวแกน x
y: stage.getHeight() / 2, // กำหนดแนวแกน y
radius: { // กำหนดรัศมี ตามแนวแกน x และแกน y
x: 100,
y: 50
},
fill: 'blue', // ใส่สีพื้น
stroke: 'black', // กำหนดสีเส้น
strokeWidth: 4 // กำหนดขนาดเส้น
});
// add the shape to the layer
layer.add(oval);
// add the layer to the stage
stage.add(layer);
ผลลัพธ์ที่ได้คือ

0 comments:
Post a Comment