LivelyKernel/LivelyKernel — pull request #113 by rksm (2013-02-28 03:30:51+00:00)
Title: Implements a simple buildspec construction for morphs

Implements a simple buildspec construction for morphs.

A spec can be generated from a morph with

```js
morph.buildSpec();
```

The result of this is a JSON-like object. For a simple rectangle this
produces:

```json
{
"_ClipMode" : "visible",
"_Extent" : "lively.pt(100.0,100.0)",
"_Position" : "lively.pt(38.0,514.0)",
"_Rotation" : 0,
"_Scale" : 1,
"className" : "lively.morphic.Box",
"droppingEnabled" : true,
"halosEnabled" : true,
"name" : "Rectangle1",
"showsHalos" : false,
"sourceModule" : "lively.morphic.Core",
"submorphs" : []
}
```

To create a morph from a spec use

```js
morph = lively.morphic.Morph.fromSpec(spec);
```