javascript - How to get Children that have same type Kineticjs? -
i have trouble in kineticjs, in code:
var g1=new kinetic.group() var sq=new kinetic.rect({ x:0, y:0, name:"sq" }) var line1=new kinetic.line({ points:[0,0,10,10], name:"line1" }) var line2=new kinetic.line({ points:[0,0,50,50], name:"line1" }) g1.add(sq).add(line1).add(line2)
i know children g1 type "g1.getchildren()". children has same type example type kinetic.line don't have idea. please me, tahnks
sorry not having tutorial on this, can select children type this:
var shapes = layer.get('line');
in kineticjs, shape types similar dom tags. can select them name.
Comments
Post a Comment