melanke / CascadeCanvas

A framework for canvas that follows the Javascript patterns you already know
6 stars 0 forks source link

Let the developer implement new 'Drawers' #37

Open melanke opened 10 years ago

melanke commented 10 years ago

Today we have layers and each layers is described by 'properties' like 'fill', 'stroke', 'sprite', etc.

But if those properties were 'Drawers' that could be added to CC and someone could simply do:

CC.drawer("drawerName", function(element, layer, config, screen) {
    //and implement a way to render when user uses "drawerName"
});

CC("#Element").e(0).layers.layerName = {
    fill: { color: "red" },
    drawerName: { /* the properties specified by the author of drawerName */ }
};

But we should think about a way to work with toggleLayers properly