0
다른 레이어에 몇 개의 Kineticjs 레이어를 추가하려고하는데 다음과 같은 코드가 있는데 아무 것도 표시되지 않습니다. 나는 캔버스에 추가 된 다른 모양을 가지고 있으며, 모든 레이어를 따로 추가하면 나타납니다. 이 버그입니까 아니면 내가 잘못하고있는 거지?다른 레이어에 레이어 추가
this.canvas = new Kinetic.Stage({ "container": jQuery("#testElement").get(0),
"width": ShooterGame.WIDTH, "height": ShooterGame.HEIGHT });
this.container = new Kinetic.Layer();
this.layer1 = new Kinetic.Layer();
this.layer2 = new Kinetic.Layer();
this.layer3 = new Kinetic.Layer();
this.layer1Bg = new Kinetic.Rect({ "width": 100, "height": 100, "fill": "#FF0000" });
this.layer2Bg = new Kinetic.Rect({ "width": 100, "height": 100, "fill": "#FF0000" });
this.layer3Bg = new Kinetic.Rect({ "width": 100, "height": 100, "fill": "#FF0000" });
this.layer1.add(this.layer1Bg);
this.layer2.add(this.layer2Bg);
this.layer3.add(this.layer3Bg);
this.container.add(this.layer1);
this.container.add(this.layer2);
this.container.add(this.layer3);
this.canvas.add(this.container);
this.container.draw();
다른 레이어에 레이어를 추가하는 목적은 무엇입니까? 그들을 그룹화? – Delapouite
그래, 정확히 맞은 – soulBit