Skip to content

Instantly share code, notes, and snippets.

@kuon
Created November 15, 2010 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuon/700274 to your computer and use it in GitHub Desktop.
Save kuon/700274 to your computer and use it in GitHub Desktop.
var editor = new SGU.ScreenEditor('SGScreenEditor',
{screenWidth: SG.screenLayoutController.get('width'),
screenHeight:SG.screenLayoutController.get('height')});
SG.currentScreenEditor = editor;
var surfaces = SG.screenLayoutController.get('surfaces');
editor._surfaces = surfaces;
surfaces.forEach(function (s) {
s._zone = new SGU.ScreenEditor.Zone(editor);
s.addObserver('status', {cb:function(obj) {
console.log('status');
console.log(obj.toString());
if(!obj.isLoaded())
return;
s._zone.create(obj.get('x'),
obj.get('y'),
obj.get('width'),
obj.get('height'));
}}, 'cb');
s.refresh();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment