[Sugar-devel] [Karma] reason for KLayer

Bryan Berry bryan at olenepal.org
Fri Sep 4 05:54:43 EDT 2009


i have been looking at the method for adding layers --

k.layer( {id:"inline1", canvas:"inlineCanvas1"} );
k.layer( {id:"inline2", canvas:"inlineCanvas2"} );
k.layer( {id:"card1", width:250, height:250} ); 
k.layer( {id:"card2", width:250, height:250} );
k.layer( {id:"card3", width:250, height:250} );

It seems that it would be nice to add these layers in k.init
just like we add sounds and images. I think the way that u add sounds
and images is very intuitive. It would be nice to use the same mechanism
for the layers as well.

then it would look like 
k.init ( ......
layers : [
	{ id: "inline1", canvas:"inlineCanvas1"},
        {id:"inline2", canvas:"inlineCanvas2"},
        {id:"card1", width:250, height:250}
        ]

sounds :

images :

)

then it would be nice to iterate thru the layers w/ similar syntax to
iterating thru the images or sounds

$.each(library.layers, function ....);

I realize I can now iterate thru the layers w/

$.each(layers, function ...);

but perhaps it would be easier to remember as library.layers because
that is how we also access the sounds and images.

What u think?

-- 
Bryan W. Berry
Technology Director
OLE Nepal, http://www.olenepal.org



More information about the Sugar-devel mailing list