Lively Kernel canvas
// this script is evaluated on world load
Template40
ProgrammierenimWebmitLivelyKernel18null
-EinführungLivelyKernel30
-EinführungLivelyKernel30
$morph("topTitle").ignoreEvents()orange=Color.rgb(223,70,0)blue=Color.rgb(0,90,143)black=Color.rgb(40,40,40)$morph("titleText").setTextColor(blue)//applystyle$morph("titleText").setPosition(pt(50.0,30.0))$morph("logoImage").setPosition(pt(950.0,15.0))//ItemLayoutConfig.customPageStyle={itemLevel1:{fontSize:30},itemLevel2:{fontSize:20},}PageStyle={isItemLevel1:function(textMorph){returntextMorph.getFontSize()==Config.customPageStyle.itemLevel1.fontSize},isItemLevel2:function(textMorph){returntextMorph.getFontSize()==Config.customPageStyle.itemLevel2.fontSize}}layoutMorphsVerically=function(morphs,topLeft,space,itemIndent){varpos=topLeft||pt(100,100);if(space===undefined)space=20;if(itemIndent===undefined)itemIndent=40;varverticallySortedMorphs=morphs.sort(function(a,b){returna.getPosition().y-b.getPosition().y})verticallySortedMorphs.each(function(ea){//console.log("pos"+pos)if(PageStyle.isItemLevel2(ea))ea.setPosition(pt(pos.x+itemIndent,pos.y));elseea.setPosition(pos);pos=pos.addPt(pt(0,space+ea.shape.bounds().height))})};listItems1and2=WorldMorph.current().submorphs.select(function(ea){varpageStyle=Config.customPageStyle;returnea.getFontSize&&(PageStyle.isItemLevel1(ea)||PageStyle.isItemLevel2(ea))})layoutMorphsVerically(listItems1and2,pt(50,100),5,40)WorldMorph.current().setDisplayTheme(WorldMorph.current().displayThemes['hpi'])//shrinktheworldtodemosizebasicResize(this.world(),this.world().canvas(),1024,768);this.world().setBorderColor(Color.black);this.world().setBorderWidth(0.25)
nulltrue4truetruefalsetruetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
StyeScriptsfalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
null44