Lively Kernel canvas
var w=WorldMorph.current()
var x;
w.submorphs.forEach(function(ea) {
ea.submorphs.forEach(function(ea2) { if (ea2 instanceof ImageMorph) x=ea2 });
});
x.layoutChanged()
0.16087.82863475390548
-1.60355269743473182.7802958552664636
ScriptingwithLivelyWiki303
FabrikandTileScriptingAlthoughthistutorialwillonlyexplainhowtocreatescriptswithJavaScript,LivelyWikiprovidesotherwaystocreatebehavior.WithFabrikandTileScriptingforexample,scriptingisnotharderthanclickinganddraggingobjects.JavaScriptJavaScriptexpressionscanbeevaluatedeverywhere.Justselectthetextyouwishtoevaluate(orselectnothingtoevaluatethecurrentline)andpressalt+d.TheexpressionMorph.makeRectangle(newRectangle(50,100,80,80)).openInWorld()willcreateanewobjectatthepositionpt(50,100)withthewidthandheightof80.Theshortcutalt+pwillevaluateandprinttheresultofexpressions.Tryitwith:1+2+3+4+5Alt+shift+iwillopenaninspectorontheresultofanexpression.TryitandinspectWorldMorph.current()toexaminetheworldobject.Youcanalsoreachtheseandmorefunctionswhenyoualt+clickinsideatext(submenu'Textfunctions...').22
Previous22
Next22
Wikicontroltruetruenull30