专业人士的简单问题..我想要ouptut数组项目,并改变y位置。我错过了一些东西。输出在同一行。这是我的Jsfiddle。谢谢你的帮助。
var s = new Kinetic.Stage({container: 'toolpanel', width:500, height:700});
var l = new Kinetic.Layer();
var cp3 = new Kinetic.Rect({x: 100,y: 10,width: 400,height:700, stroke:'black'});
l.add(cp3);
var desc = new Kinetic.Text({x: cp3.getWidth()/ 2,y: 20,text: 'Your Personalization',fontSize: 16,fontFamily: 'arial',fill: 'black',padding: 4});
l.add(desc);
s.add(l);
var odesc = [];
odesc.push("Glove Type:_20");
odesc.push("Glove Series:_40");
odesc.push("Glove Positons:_60");
for (var s = 0; s < odesc.length; s++){
var db = odesc[s];
var sdb = db.split("_");
var text = sdb[0];
var ly = 0;
var label = new Kinetic.Text({
x: 100,
y: ly+=20,
text: text,
fontSize: 16 ,
fontFamily: 'arial',
fill: 'black',
padding: 1,
align: 'left'
});
l.add(label); ly += 10;
} l.draw();