Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965{ "name": "Scroll", "events": [ { "eventType": "include", "includeSheet": "Core" }, { "eventType": "group", "disabled": false, "title": "Scroll", "description": "", "isActiveOnStart": true, "children": [ { "eventType": "variable", "name": "gap", "type": "number", "initialValue": "0", "comment": "", "isStatic": true, "isConstant": false, "sid": 113421401639537 }, { "eventType": "variable", "name": "horizontal", "type": "number", "initialValue": "0", "comment": "", "isStatic": true, "isConstant": false, "sid": 457398702272753 }, { "eventType": "variable", "name": "reverse", "type": "number", "initialValue": "0", "comment": "", "isStatic": true, "isConstant": false, "sid": 682007744290155 }, { "eventType": "comment", "text": "[h3]Initialize[/h3]" }, { "eventType": "block", "conditions": [ { "id": "on-start-of-layout", "objectClass": "System", "sid": 656354032815003 } ], "actions": [ { "type": "comment", "text": "👋 Interpret Parameters", "background-color": [ 0.6196078431372549, 0.9568627450980393, 1, 1 ] }, { "callFunction": "InitParameters", "sid": 241511989827478, "parameters": [ "1" ] } ], "sid": 651985197958005, "children": [ { "eventType": "comment", "text": "[b]1st Parameter[/b] Way" }, { "eventType": "block", "conditions": [ { "id": "compare-two-values", "objectClass": "System", "sid": 572962384942708, "parameters": { "first-value": "Functions.CheckParameter(1)", "comparison": 0, "second-value": "1" } }, { "id": "compare-two-values", "objectClass": "System", "sid": 687586870736630, "parameters": { "first-value": "lowercase(Functions.GetParameter(1)) = \"up\" | lowercase(Functions.GetParameter(1)) = \"down\" | lowercase(Functions.GetParameter(1)) = \"left\" | lowercase(Functions.GetParameter(1)) = \"right\"", "comparison": 0, "second-value": "1" } } ], "actions": [], "sid": 415722347135563, "children": [ { "eventType": "block", "conditions": [ { "id": "compare-two-values", "objectClass": "System", "sid": 858270173638226, "parameters": { "first-value": "lowercase(Functions.GetParameter(1))", "comparison": 0, "second-value": "\"up\"" } } ], "actions": [ { "id": "set-eventvar-value", "objectClass": "System", "sid": 743371234049923, "parameters": { "variable": "horizontal", "value": "0" } }, { "id": "set-eventvar-value", "objectClass": "System", "sid": 818086968879596, "parameters": { "variable": "reverse", "value": "1" } }, { "id": "set-at-x", "objectClass": "ParamsArray", "sid": 297519644018133, "parameters": { "x": "0", "value": "\"Up\"" } }, { "callFunction": "SpecifiedParameter", "sid": 262822116110115, "parameters": [ "1" ] } ], "sid": 746596222904508 }, { "eventType": "block", "conditions": [ { "id": "compare-two-values", "objectClass": "System", "sid": 992835712002968, "parameters": { "first-value": "lowercase(Functions.GetParameter(1))", "comparison": 0, "second-value": "\"right\"" } } ], "actions": [ { "id": "set-eventvar-value", "objectClass": "System", "sid": 690592831669700, "parameters": { "variable": "horizontal", "value": "1" } }, { "id": "set-eventvar-value", "objectClass": "System", "sid": 203335207920607, "parameters": { "variable": "reverse", "value": "1" } }, { "id": "set-at-x", "objectClass": "ParamsArray", "sid": 411583474508815, "parameters": { "x": "0", "value": "\"Right\"" } }, { "callFunction": "SpecifiedParameter", "sid": 262822116110115, "parameters": [ "1" ] } ], "sid": 952482818168724 }, { "eventType": "block", "conditions": [ { "id": "compare-two-values", "objectClass": "System", "sid": 549358548680558, "parameters": { "first-value": "lowercase(Functions.GetParameter(1))", "comparison": 0, "second-value": "\"down\"" } } ], "actions": [ { "id": "set-eventvar-value", "objectClass": "System", "sid": 641268978739423, "parameters": { "variable": "horizontal", "value": "0" } }, { "id": "set-eventvar-value", "objectClass": "System", "sid": 798547377232063, "parameters": { "variable": "reverse", "value": "0" } }, { "id": "set-at-x", "objectClass": "ParamsArray", "sid": 679499731493479, "parameters": { "x": "0", "value": "\"Down\"" } }, { "callFunction": "SpecifiedParameter", "sid": 262822116110115, "parameters": [ "1" ] } ], "sid": 946558981198440 }, { "eventType": "block", "conditions": [ { "id": "compare-two-values", "objectClass": "System", "sid": 247496628053436, "parameters": { "first-value": "lowercase(Functions.GetParameter(1))", "comparison": 0, "second-value": "\"left\"" } } ], "actions": [ { "id": "set-eventvar-value", "objectClass": "System", "sid": 933751428702264, "parameters": { "variable": "horizontal", "value": "1" } }, { "id": "set-eventvar-value", "objectClass": "System", "sid": 527534868105899, "parameters": { "variable": "reverse", "value": "0" } }, { "id": "set-at-x", "objectClass": "ParamsArray", "sid": 336481379853972, "parameters": { "x": "0", "value": "\"Left\"" } }, { "callFunction": "SpecifiedParameter", "sid": 262822116110115, "parameters": [ "1" ] } ], "sid": 340173202907067 } ] }, { "eventType": "block", "conditions": [ { "id": "else", "objectClass": "System", "sid": 263158759082424 } ], "actions": [ { "id": "set-eventvar-value", "objectClass": "System", "sid": 180835223584893, "parameters": { "variable": "horizontal", "value": "choose(0, 1)" } }, { "id": "set-eventvar-value", "objectClass": "System", "sid": 470202303554730, "parameters": { "variable": "reverse", "value": "choose(0, 1)" } } ], "sid": 237625885429925, "children": [ { "eventType": "block", "conditions": [ { "id": "compare-eventvar", "objectClass": "System", "sid": 996233759708781, "parameters": { "variable": "horizontal", "comparison": 0, "value": "0" } }, { "id": "compare-eventvar", "objectClass": "System", "sid": 604465633842072, "parameters": { "variable": "reverse", "comparison": 0, "value": "1" } } ], "actions": [ { "callFunction": "GeneratedParameter", "sid": 584396661858851, "parameters": [ "1", "\"Up\"", "\"\"" ] } ], "sid": 754701644534575 }, { "eventType": "block", "conditions": [ { "id": "else", "objectClass": "System", "sid": 542819888380825 }, { "id": "compare-eventvar", "objectClass": "System", "sid": 359981311242304, "parameters": { "variable": "horizontal", "comparison": 0, "value": "1" } }, { "id": "compare-eventvar", "objectClass": "System", "sid": 784361988051512, "parameters": { "variable": "reverse", "comparison": 0, "value": "1" } } ], "actions": [ { "callFunction": "GeneratedParameter", "sid": 492149936927444, "parameters": [ "1", "\"Right\"", "\"\"" ] } ], "sid": 476083327652121 }, { "eventType": "block", "conditions": [ { "id": "else", "objectClass": "System", "sid": 446427177611928 }, { "id": "compare-eventvar", "objectClass": "System", "sid": 970933040767774, "parameters": { "variable": "horizontal", "comparison": 0, "value": "0" } }, { "id": "compare-eventvar", "objectClass": "System", "sid": 750989958860688, "parameters": { "variable": "reverse", "comparison": 0, "value": "0" } } ], "actions": [ { "callFunction": "GeneratedParameter", "sid": 634191207726541, "parameters": [ "1", "\"Down\"", "\"\"" ] } ], "sid": 423232102787783 }, { "eventType": "block", "conditions": [ { "id": "else", "objectClass": "System", "sid": 205299506110472 }, { "id": "compare-eventvar", "objectClass": "System", "sid": 878934598884795, "parameters": { "variable": "horizontal", "comparison": 0, "value": "1" } }, { "id": "compare-eventvar", "objectClass": "System", "sid": 239039358350592, "parameters": { "variable": "reverse", "comparison": 0, "value": "0" } } ], "actions": [ { "callFunction": "GeneratedParameter", "sid": 111861521874474, "parameters": [ "1", "\"Left\"", "\"\"" ] } ], "sid": 122073482347140 } ] }, { "eventType": "block", "conditions": [], "actions": [ { "type": "comment", "text": "🛑 Print Parameters", "background-color": [ 0.9294117647058824, 0.7764705882352941, 0.984313725490196, 1 ] }, { "callFunction": "PrintParameterHint", "sid": 714465216338809 } ], "sid": 871678884240973 }, { "eventType": "comment", "text": "[h4]Finish Initialization[/h4]" }, { "eventType": "block", "conditions": [], "actions": [ { "type": "comment", "text": "Save the Painting" }, { "id": "paste-object", "objectClass": "PaintingBuffer", "sid": 523416975668193, "parameters": { "object": "Painting", "effects": "with-effects" } }, { "type": "comment", "text": "Setup" }, { "id": "play", "objectClass": "Audio", "sid": 760896836742250, "parameters": { "audio-file": { "path": "Brushes/Scroll/Scroll - Theme 2021" }, "loop": "looping", "volume": "-5", "stereo-pan": "0", "tag-optional": "\"Scroll\"" } }, { "id": "add-filter-effect", "objectClass": "Audio", "sid": 450644042747866, "parameters": { "tag": "\"\"", "type": "low-shelf", "frequency": "-5", "detune": "0", "q": "1", "gain": "0", "mix": "100" } }, { "id": "set-eventvar-value", "objectClass": "System", "sid": 534905561192620, "parameters": { "variable": "gap", "value": "choose(1, 2, 4, 8, 16)" } }, { "id": "start-timer", "objectClass": "Clock", "sid": 718175608988693, "behaviorType": "Timer", "parameters": { "duration": "0.1", "type": "regular", "tag": "\"Scroll\"" } }, { "id": "signal", "objectClass": "System", "sid": 800910647751190, "parameters": { "tag": "\"Brush Started\"" } } ], "sid": 802355489918606 } ] }, { "eventType": "comment", "text": "[h3]Audio[/h3]" }, { "eventType": "comment", "text": "[b]Play Theme Music[/b]", "background-color": [ 0.8196078431372549, 0.9725490196078431, 1, 1 ] }, { "eventType": "block", "conditions": [ { "id": "on-start-of-layout", "objectClass": "System", "sid": 903486723113882 } ], "actions": [ { "callFunction": "PaintingMusicMute", "sid": 151912234952034, "parameters": [ true ] } ], "sid": 780597420678126 }, { "eventType": "block", "conditions": [ { "id": "every-tick", "objectClass": "System", "sid": 685348768486929 } ], "actions": [ { "callFunction": "SilentOnPause", "sid": 253871328926907, "parameters": [ "\"Scroll\"" ] } ], "sid": 153093180013184 }, { "eventType": "comment", "text": "[h3]Present[/h3]" }, { "eventType": "block", "conditions": [ { "id": "on-timer", "objectClass": "Clock", "sid": 566437917992127, "behaviorType": "Timer", "parameters": { "tag": "\"Scroll\"" } } ], "actions": [ { "callFunction": "ScrollRender", "sid": 397102530802896 } ], "sid": 577113331666350 }, { "functionName": "ScrollRender", "functionDescription": "", "functionCategory": "", "functionReturnType": "none", "functionCopyPicked": false, "functionIsAsync": false, "functionParameters": [], "eventType": "function-block", "conditions": [], "actions": [ { "type": "script", "language": "javascript", "script": [ "const imageData = await runtime.objects.PaintingBuffer.getFirstInstance().getImagePixelData()", "const data = imageData.data", "const newImageData = new ImageData(imageData.width, imageData.height)", "const newData = newImageData.data", "", "const gap = localVars.gap", "const horizontal = localVars.horizontal", "const reverse = localVars.reverse", "", "let start = gap", "let dataIndex, newDataIndex", "", "// Copy from data to newData, taking the stride of pixels into account, based on the direction.", "", "if (horizontal) {", "", "\tif (reverse) { // Right", "\t", "\t\tfor (let x = 0; x < imageData.width; x += 1) {", "\t\t\tfor (let y = 0; y < imageData.height; y += 1) {", "\t\t\t\tdataIndex = main.getColorIndicesForCoord(x, y, imageData.width)", "\t\t\t\tnewDataIndex = main.getColorIndicesForCoord(start, y, imageData.width)", "", "\t\t\t\tnewData[newDataIndex[0]] = data[dataIndex[0]] ", "\t\t\t\tnewData[newDataIndex[1]] = data[dataIndex[1]]", "\t\t\t\tnewData[newDataIndex[2]] = data[dataIndex[2]]", "\t\t\t\tnewData[newDataIndex[3]] = data[dataIndex[3]]", "\t\t\t}", "\t\t\tstart = (start + 1) % imageData.width", "\t\t}", "\t\t", "\t} else { // Left", "\t", "\t\tfor (let x = 0; x < imageData.width; x += 1) {", "\t\t\tfor (let y = 0; y < imageData.height; y += 1) {", "\t\t\t\tlet dataIndex, newDataIndex", "", "\t\t\t\tdataIndex = main.getColorIndicesForCoord(imageData.width - 1 - x, y, imageData.width)", "\t\t\t\tnewDataIndex = main.getColorIndicesForCoord(imageData.width - 1 - start, y, imageData.width)", "", "\t\t\t\tnewData[newDataIndex[0]] = data[dataIndex[0]] ", "\t\t\t\tnewData[newDataIndex[1]] = data[dataIndex[1]]", "\t\t\t\tnewData[newDataIndex[2]] = data[dataIndex[2]]", "\t\t\t\tnewData[newDataIndex[3]] = data[dataIndex[3]]", "\t\t\t}", "\t\t\tstart = (start + 1) % imageData.width", "\t\t}", "\t\t", "\t}", "", "} else {", "", "\tif (reverse) { // Down", "\t", "\t\tfor (let y = 0; y < imageData.height; y += 1) {", "\t\t\tfor (let x = 0; x < imageData.width; x += 1) {", "\t\t\t\tdataIndex = main.getColorIndicesForCoord(x, y, imageData.width)", "\t\t\t\tnewDataIndex = main.getColorIndicesForCoord(x, start, imageData.width)", "\t\t\t\t", "\t\t\t\tnewData[newDataIndex[0]] = data[dataIndex[0]] ", "\t\t\t\tnewData[newDataIndex[1]] = data[dataIndex[1]]", "\t\t\t\tnewData[newDataIndex[2]] = data[dataIndex[2]]", "\t\t\t\tnewData[newDataIndex[3]] = data[dataIndex[3]]", "\t\t\t}", "\t\t\tstart = (start + 1) % imageData.height", "\t\t}", "\t", "\t} else { // Up", "\t", "\t\tfor (let y = 0; y < imageData.height; y += 1) {", "\t\t\tfor (let x = 0; x < imageData.width; x += 1) {", "\t\t\t\tdataIndex = main.getColorIndicesForCoord(x, imageData.height - 1 - y, imageData.width)", "\t\t\t\tnewDataIndex = main.getColorIndicesForCoord(x, imageData.height - 1 - start, imageData.width)", "", "\t\t\t\tnewData[newDataIndex[0]] = data[dataIndex[0]] ", "\t\t\t\tnewData[newDataIndex[1]] = data[dataIndex[1]]", "\t\t\t\tnewData[newDataIndex[2]] = data[dataIndex[2]]", "\t\t\t\tnewData[newDataIndex[3]] = data[dataIndex[3]]", "\t\t\t}", "\t\t\tstart = (start + 1) % imageData.height", "\t\t}", "\t}", "\t", "}", "", "runtime.objects.PaintingBuffer.getFirstInstance().loadImagePixelData(newImageData)" ] }, { "callFunction": "WorkAroundPixelAccessFlip", "sid": 672050885436697 }, { "id": "wait-for-previous-actions", "objectClass": "System", "sid": 516980862241699 } ], "sid": 149816218461894 }, { "eventType": "comment", "text": "[h3]Nudge[/h3]" }, { "eventType": "block", "conditions": [ { "id": "compare-boolean-eventvar", "objectClass": "System", "sid": 268309384329798, "parameters": { "variable": "Nudging" } }, { "id": "trigger-once-while-true", "objectClass": "System", "sid": 438143933894968 } ], "actions": [ { "type": "comment", "text": "Nudge [b]Started[/b]" }, { "type": "comment", "text": "Nudge [b]Ended[/b]" }, { "id": "wait-for-signal", "objectClass": "System", "sid": 311732548597401, "parameters": { "tag": "\"Nudge Ended\"" } }, { "callFunction": "PaintingMusicMute", "sid": 857175487622544, "parameters": [ false ] } ], "sid": 106370992543171 }, { "eventType": "block", "conditions": [ { "id": "compare-boolean-eventvar", "objectClass": "System", "sid": 611134647292911, "parameters": { "variable": "Nudging" } }, { "id": "trigger-once-while-true", "objectClass": "System", "sid": 268856213341574 } ], "actions": [ { "callFunction": "NoNudge", "sid": 119571280047977 } ], "sid": 710673956919090 }, { "eventType": "comment", "text": "[h3]Paint[/h3]" }, { "eventType": "block", "conditions": [ { "id": "compare-boolean-eventvar", "objectClass": "System", "sid": 821167476453995, "parameters": { "variable": "Painting" } } ], "actions": [ { "type": "comment", "text": "There is a bug where the filter moves forward a tick while painting." }, { "id": "paste-object", "objectClass": "Painting", "sid": 439586629081289, "parameters": { "object": "PaintingBuffer", "effects": "with-effects" } }, { "type": "comment", "text": "Signify to [b]Core[/b] that the canvas has been painted." }, { "id": "signal", "objectClass": "System", "sid": 151450716850048, "parameters": { "tag": "\"painted\"" } } ], "sid": 938043978661359 }, { "eventType": "comment", "text": "[h3]DeInitialize[/h3]" }, { "eventType": "block", "conditions": [ { "id": "on-end-of-layout", "objectClass": "System", "sid": 179408976216659 } ], "actions": [ { "id": "stop", "objectClass": "Audio", "sid": 470575492488586, "parameters": { "tag": "\"Scroll\"" } } ], "sid": 851522078778026 } ], "sid": 581473106031232 } ], "sid": 969045321213597}