1

How can I add a background color to a layer in kineticjs? I want to have multiple layers which have different background colors.

Something like:

var layer = new Kinetic.Layer({
                x: 0,
                y: 0,
                width : that.locationData.getCreativeLeftLoc(),
                height : that.locationData.getCreativeTopLoc(),
                background-color : 'black'
            });
4

1 回答 1

4

You can't. See the docs.

It goes Node > Container > Layer, none of which support drawing to themselves. They serve only to group other kinetic objects.

于 2012-12-07T16:55:20.537 回答