diff --git a/examples/advanced-shape-based-painter/advanced-shape-based-painter.json b/examples/advanced-shape-based-painter/advanced-shape-based-painter.json index 0589d0765..1521c78f3 100755 --- a/examples/advanced-shape-based-painter/advanced-shape-based-painter.json +++ b/examples/advanced-shape-based-painter/advanced-shape-based-painter.json @@ -1,13 +1,15 @@ { "firstLayout": "", "gdVersion": { - "build": 99, - "major": 4, - "minor": 0, + "build": 213, + "major": 5, + "minor": 4, "revision": 0 }, "properties": { "adaptGameResolutionAtRuntime": false, + "antialiasingMode": "MSAA", + "antialisingEnabledOnMobile": false, "folderProject": false, "orientation": "default", "packageName": "com.example.shapepainter", @@ -15,9 +17,11 @@ "projectUuid": "49af45a6-8dc7-4f4e-bce8-5fe696257fd1", "scaleMode": "linear", "sizeOnStartupMode": "", + "templateSlug": "", "useExternalSourceFiles": false, "version": "1.0.0", "name": "Advanced Shape Painter", + "description": "", "author": "", "windowWidth": 800, "windowHeight": 600, @@ -42,9 +46,16 @@ "showGDevelopSplash": true, "showProgressBar": true }, + "watermark": { + "placement": "bottom-left", + "showWatermark": true + }, "authorIds": [ "t0AOR3JaOlak1TykejmNhjR5UQb2" ], + "authorUsernames": [], + "categories": [], + "playableDevices": [], "extensionProperties": [], "platforms": [ { @@ -113,6 +124,9 @@ "resourceFolders": [] }, "objects": [], + "objectsFolderStructure": { + "folderName": "__ROOT" + }, "objectsGroups": [], "variables": [], "layouts": [ @@ -121,9 +135,6 @@ "disableInputWhenNotFocused": true, "mangledName": "Scene", "name": "Scene", - "oglFOV": 90, - "oglZFar": 500, - "oglZNear": 1, "r": 209, "standardSortMethod": true, "stopSoundsOnStartup": true, @@ -132,13 +143,13 @@ "uiSettings": { "grid": false, "gridType": "rectangular", - "gridWidth": 32, - "gridHeight": 32, + "gridWidth": 4, + "gridHeight": 4, "gridOffsetX": 0, "gridOffsetY": 0, "gridColor": 10401023, "gridAlpha": 0.8, - "snap": true, + "snap": false, "zoomFactor": 1, "windowMask": false }, @@ -154,8 +165,8 @@ "children": [ { "name": "Border", - "type": "string", - "value": "0" + "type": "number", + "value": 0 }, { "name": "BorderColor", @@ -180,18 +191,18 @@ }, { "name": "BorderOpacity", - "type": "string", - "value": "0" + "type": "number", + "value": 0 }, { "name": "EndX", - "type": "string", - "value": "0" + "type": "number", + "value": 0 }, { "name": "EndY", - "type": "string", - "value": "0" + "type": "number", + "value": 0 }, { "name": "FillColor", @@ -216,47 +227,47 @@ }, { "name": "FillOpacity", - "type": "string", - "value": "0" + "type": "number", + "value": 0 }, { "name": "Radius", - "type": "string", - "value": "0" + "type": "number", + "value": 0 }, { "name": "StartX", - "type": "string", - "value": "0" + "type": "number", + "value": 0 }, { "name": "StartY", - "type": "string", - "value": "0" + "type": "number", + "value": 0 }, { "name": "Thickness", - "type": "string", - "value": "0" + "type": "number", + "value": 0 }, { "name": "Type", - "type": "string", - "value": "0" + "type": "number", + "value": 0 } ] }, { "name": "Size", - "type": "string", - "value": "-1" + "type": "number", + "value": -1 } ] }, { "name": "i", - "type": "string", - "value": "0" + "type": "number", + "value": 0 }, { "name": "else", @@ -265,13 +276,13 @@ }, { "name": "shape", - "type": "string", - "value": "0" + "type": "number", + "value": 0 }, { - "name": "drawing", - "type": "string", - "value": "0" + "name": "isDrawing", + "type": "boolean", + "value": false }, { "name": "R", @@ -290,8 +301,14 @@ }, { "name": "A", - "type": "string", - "value": "100" + "type": "number", + "value": 100 + }, + { + "folded": true, + "name": "canDraw", + "type": "boolean", + "value": false } ], "instances": [ @@ -300,7 +317,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "Drawer", "persistentUuid": "1fb23849-d60e-4e8f-96e1-7e2e20d988c0", "width": 0, @@ -322,7 +338,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "BarSelect", "persistentUuid": "c3144d13-d5d7-41dd-908a-3b1eecd1bd14", "width": 0, @@ -333,9 +348,10 @@ "stringProperties": [], "initialVariables": [ { + "folded": true, "name": "ID", - "type": "string", - "value": "3" + "type": "number", + "value": 3 } ] }, @@ -344,7 +360,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "BarSelect", "persistentUuid": "0bf1ca5d-2b6d-4d00-8128-29338d3a89fa", "width": 0, @@ -353,20 +368,13 @@ "zOrder": 1, "numberProperties": [], "stringProperties": [], - "initialVariables": [ - { - "name": "ID", - "type": "string", - "value": "0" - } - ] + "initialVariables": [] }, { "angle": 0, "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "BarSelect", "persistentUuid": "6389becb-a502-4967-baa5-68b9d0c353ba", "width": 0, @@ -377,9 +385,10 @@ "stringProperties": [], "initialVariables": [ { + "folded": true, "name": "ID", - "type": "string", - "value": "1" + "type": "number", + "value": 1 } ] }, @@ -388,7 +397,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "BarSelect", "persistentUuid": "82ad3623-fdf2-4962-9e2d-604484a3ea35", "width": 0, @@ -399,9 +407,10 @@ "stringProperties": [], "initialVariables": [ { + "folded": true, "name": "ID", - "type": "string", - "value": "2" + "type": "number", + "value": 2 } ] }, @@ -410,7 +419,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "message", "persistentUuid": "a0ad8fec-cdc3-4398-af1a-02a5282931e0", "width": 0, @@ -420,12 +428,76 @@ "numberProperties": [], "stringProperties": [], "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "ObjR", + "persistentUuid": "c4767c7f-6713-4f33-9c45-7e7365d8507c", + "width": 0, + "x": 16, + "y": 396, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "ObjG", + "persistentUuid": "225ea3ac-d21c-4eaa-876d-45d7cd69985a", + "width": 0, + "x": 16, + "y": 428, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "ObjB", + "persistentUuid": "ae04b256-ffb5-45d7-8f2b-0f0d90bc76d7", + "width": 0, + "x": 16, + "y": 460, + "zOrder": 5, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "ObjA", + "persistentUuid": "44b9e403-94a8-43bc-8c5f-d1ce29992895", + "width": 0, + "x": 16, + "y": 488, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] } ], "objects": [ { + "assetStoreId": "", "name": "Drawer", - "tags": "", "type": "PrimitiveDrawing::Drawer", "variables": [ { @@ -470,11 +542,13 @@ "r": 0 }, "absoluteCoordinates": true, - "clearBetweenFrames": true + "clearBetweenFrames": true, + "antialiasing": "none" }, { - "name": "Shapes", - "tags": "", + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "ObjShapes", "type": "Sprite", "updateIfNotVisible": true, "variables": [], @@ -676,20 +750,27 @@ ] }, { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", "name": "BarSelect", - "tags": "", "type": "Sprite", "updateIfNotVisible": true, "variables": [ { - "name": "Drag", - "type": "string", - "value": "0" + "name": "isDragged", + "type": "boolean", + "value": false }, { "name": "Value", - "type": "string", - "value": "0" + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "ID", + "type": "number", + "value": 0 } ], "effects": [], @@ -746,11 +827,11 @@ ] }, { + "assetStoreId": "", "bold": false, "italic": false, "name": "message", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -758,18 +839,230 @@ "behaviors": [], "string": "Click the Shape buttons on the left to select a shape\nDrag the bars below to change color and opacity\nClick the empty area to start drawing the selected shape", "font": "", + "textAlignment": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Click the Shape buttons on the left to select a shape\nDrag the bars below to change color and opacity\nClick the empty area to start drawing the selected shape", + "font": "", + "textAlignment": "", + "characterSize": 20, + "color": "0;0;0" + } + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "ObjR", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "R", + "font": "", + "textAlignment": "left", + "characterSize": 20, + "color": { + "b": 27, + "g": 2, + "r": 208 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "R", + "font": "", + "textAlignment": "left", + "characterSize": 20, + "color": "208;2;27" + } + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "ObjG", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "G", + "font": "", + "textAlignment": "left", + "characterSize": 20, + "color": { + "b": 33, + "g": 211, + "r": 126 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "G", + "font": "", + "textAlignment": "left", + "characterSize": 20, + "color": "126;211;33" + } + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "ObjB", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "B", + "font": "", + "textAlignment": "left", + "characterSize": 20, + "color": { + "b": 250, + "g": 58, + "r": 0 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "B", + "font": "", + "textAlignment": "left", + "characterSize": 20, + "color": "0;58;250" + } + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "ObjA", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "A", + "font": "", + "textAlignment": "left", "characterSize": 20, "color": { "b": 0, "g": 0, "r": 0 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "A", + "font": "", + "textAlignment": "left", + "characterSize": 20, + "color": "0;0;0" } } ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Drawer" + }, + { + "objectName": "ObjR" + }, + { + "objectName": "ObjG" + }, + { + "objectName": "ObjB" + }, + { + "objectName": "ObjShapes" + }, + { + "objectName": "BarSelect" + }, + { + "objectName": "message" + }, + { + "objectName": "ObjA" + } + ] + }, "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -779,269 +1072,239 @@ "textG": 0, "textR": 0 }, - "comment": "This example is using the shape painter object to draw shapes\nAt the beginning we are creating the graphical user interface using the Shapes object which is used to select what shape to draw\nWe also use the shape drawer object to draw the lines on the screen that we can use to drag the BarSelect objects to select the color and opacitiy of the shape", - "comment2": "" + "comment": "This example is using the shape painter object to draw shapes\nAt the beginning we are creating the graphical user interface using the Shapes object which is used to select what shape to draw\nWe also use the shape drawer object to draw the lines on the screen that we can use to drag the BarSelect objects to select the color and opacitiy of the shape" }, { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Initialize", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ { - "type": { - "inverted": false, - "value": "DepartScene" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "" - ], - "subInstructions": [] - } - ], - "actions": [ + "comment": "Create the 5 shape selector objects\nThe variable i is used to dynamically increase the position of the shape object instance on the Y axis :: 50;150+Variable(i)\nThe variable also used to display the correct animation for the object :: Change the animation frame of Shape to Variable(i)\nLater this value is also used to identify which shape was clicked as each shape is the animation of the same Shape object so we are using i as the ID value to identify them." + }, { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "i", - "=", - "0" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } ], - "subInstructions": [] + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "5", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "ObjShapes", + "50", + "150+Variable(i)*40", + "" + ] + }, + { + "type": { + "value": "ChangeSprite" + }, + "parameters": [ + "ObjShapes", + "=", + "Variable(i)" + ] + }, + { + "type": { + "value": "PauseAnimation" + }, + "parameters": [ + "ObjShapes" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "i", + "+", + "1" + ] + } + ] + } + ] } ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Update", + "source": "", + "type": "BuiltinCommonInstructions::Group", "events": [ { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "5", + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Draw the color selection lines" + }, + { + "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, - "value": "Create" + "value": "PrimitiveDrawing::FillColor" }, "parameters": [ - "", - "Shapes", - "50", - "150+Variable(i)*40", - "" - ], - "subInstructions": [] + "Drawer", + "\"0;0;0\"" + ] }, { "type": { - "inverted": false, - "value": "ChangeSprite" + "value": "PrimitiveDrawing::FillOpacity" }, "parameters": [ - "Shapes", + "Drawer", "=", - "Variable(i)" - ], - "subInstructions": [] + "255" + ] }, { "type": { - "inverted": false, - "value": "PauseAnimation" + "value": "PrimitiveDrawing::OutlineSize" }, "parameters": [ - "Shapes" - ], - "subInstructions": [] + "Drawer", + "=", + "0" + ] }, { "type": { - "inverted": false, - "value": "ModVarScene" + "value": "PrimitiveDrawing::Rectangle" }, "parameters": [ - "i", - "+", - "1" - ], - "subInstructions": [] - } - ], - "events": [] - } - ] - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "inverted": false, - "value": "PrimitiveDrawing::FillColor" - }, - "parameters": [ - "Drawer", - "\"0;0;0\"" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "PrimitiveDrawing::FillOpacity" - }, - "parameters": [ - "Drawer", - "=", - "255" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "PrimitiveDrawing::OutlineSize" - }, - "parameters": [ - "Drawer", - "=", - "0" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "PrimitiveDrawing::Rectangle" - }, - "parameters": [ - "Drawer", - "50", - "400", - "305", - "405" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "PrimitiveDrawing::Rectangle" - }, - "parameters": [ - "Drawer", - "50", - "430", - "305", - "435" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "PrimitiveDrawing::Rectangle" - }, - "parameters": [ - "Drawer", - "50", - "460", - "305", - "465" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "PrimitiveDrawing::Rectangle" - }, - "parameters": [ - "Drawer", - "50", - "490", - "305", - "495" - ], - "subInstructions": [] - } - ], - "events": [ - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "Drawer", + "50", + "400", + "305", + "405" + ] + }, { "type": { - "inverted": false, - "value": "PrimitiveDrawing::FillColor" + "value": "PrimitiveDrawing::Rectangle" }, "parameters": [ "Drawer", - "VariableString(R)+\";\"+VariableString(G)+\";\"+VariableString(B)" - ], - "subInstructions": [] + "50", + "430", + "305", + "435" + ] }, { "type": { - "inverted": false, - "value": "PrimitiveDrawing::FillOpacity" + "value": "PrimitiveDrawing::Rectangle" }, "parameters": [ "Drawer", - "=", - "Variable(A)" - ], - "subInstructions": [] + "50", + "460", + "305", + "465" + ] }, { "type": { - "inverted": false, "value": "PrimitiveDrawing::Rectangle" }, "parameters": [ "Drawer", - "310", - "400", - "405", + "50", + "490", + "305", "495" - ], - "subInstructions": [] + ] } ], - "events": [] - } - ] - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": false, - "value": "SourisBouton" - }, - "parameters": [ - "", - "Left" - ], - "subInstructions": [] - } - ], - "actions": [], - "events": [ + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::FillColor" + }, + "parameters": [ + "Drawer", + "VariableString(R)+\";\"+VariableString(G)+\";\"+VariableString(B)" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::FillOpacity" + }, + "parameters": [ + "Drawer", + "=", + "Variable(A)" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::Rectangle" + }, + "parameters": [ + "Drawer", + "310", + "400", + "405", + "495" + ] + } + ] + } + ] + }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -1051,41 +1314,24 @@ "textG": 0, "textR": 0 }, - "comment": "If the mouse is first-time pressed, set canDraw to 1 as an indication we can start drawing", - "comment2": "" + "comment": "Draw shapes" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [], - "subInstructions": [] - } - ], - "actions": [ - { - "type": { - "inverted": false, - "value": "ModVarScene" + "value": "SourisBouton" }, "parameters": [ - "canDraw", - "=", - "1" - ], - "subInstructions": [] + "", + "Left" + ] } ], + "actions": [], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -1095,216 +1341,32 @@ "textG": 0, "textR": 0 }, - "comment": "While the pointer is down, if the pointer is over a shape, get the sprite of the object and store it number in the shape variable which is used then to pick which shape to draw\nWe also set canDraw to 0 to indicate we don't want to draw just yet", - "comment2": "" + "comment": "If the mouse is first-time pressed, set canDraw to true as an indication we can start drawing" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, - "value": "SourisSurObjet" + "value": "BuiltinCommonInstructions::Once" }, - "parameters": [ - "Shapes", - "", - "" - ], - "subInstructions": [] + "parameters": [] } ], "actions": [ { "type": { - "inverted": false, - "value": "ModVarScene" + "value": "SetBooleanVariable" }, "parameters": [ "canDraw", - "=", - "0" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "shape", - "=", - "Shapes.Sprite()" - ], - "subInstructions": [] - } - ], - "events": [] - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "In case the pointer is over the BarSelect object that means we want to drag the object to change the color of the shape, we set Drag value of the objec to 1 to indicate that we are about to drag this object\nWe also set the value of canDraw to 0 to indicate we don't want to draw just yet", - "comment2": "" - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": false, - "value": "SourisSurObjet" - }, - "parameters": [ - "BarSelect", - "", + "True", "" - ], - "subInstructions": [] - } - ], - "actions": [ - { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "canDraw", - "=", - "0" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "ModVarObjet" - }, - "parameters": [ - "BarSelect", - "Drag", - "=", - "1" - ], - "subInstructions": [] - } - ], - "events": [] - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "In case the value of canDraw is 1 that means the pointer is NOT over the gui element so we can start drawing the selected shape as we move the mouse\nIn order to draw a shape, the drawer object going to need some initial values such as tart position of drawing, shape, shape size", - "comment2": "" - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": false, - "value": "VarScene" - }, - "parameters": [ - "canDraw", - "=", - "1" - ], - "subInstructions": [] - } - ], - "actions": [ - { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "drawing", - "=", - "1" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "Shapes.Size", - "+", - "1" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "Shapes[VariableString(Shapes.Size)].Type", - "=", - "Variable(shape)" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "Shapes[VariableString(Shapes.Size)].StartX", - "=", - "MouseX(\"\",0)" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "Shapes[VariableString(Shapes.Size)].StartY", - "=", - "MouseY(\"\",0)" - ], - "subInstructions": [] + ] } ], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -1314,27 +1376,46 @@ "textG": 0, "textR": 0 }, - "comment": "The shape painter object has properties that we also need to set such as RGB color values, opacity and border. We set these values here and store them in variables for each different shape we can draw", - "comment2": "" + "comment": "While the pointer is down, if the pointer is over a shape, get the sprite of the object and store it number in the shape variable which is used then to pick which shape to draw\nWe also set canDraw to false to indicate we don't want to draw just yet" }, { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Circle Filled", - "comment2": "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SourisSurObjet" + }, + "parameters": [ + "ObjShapes", + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "canDraw", + "False", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "shape", + "=", + "ObjShapes.Sprite()" + ] + } + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -1344,169 +1425,47 @@ "textG": 0, "textR": 0 }, - "comment": "Rectangle Filled", - "comment2": "" + "comment": "In case the pointer is over the BarSelect object that means we want to drag the object to change the color of the shape, we set isDragged value of the objec to true to indicate that we are about to drag this object\nWe also set the value of canDraw to false to indicate we don't want to draw just yet" }, { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Line", - "comment2": "" - }, - { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, - "value": "BuiltinCommonInstructions::Or" + "value": "SourisSurObjet" }, - "parameters": [], - "subInstructions": [ - { - "type": { - "inverted": false, - "value": "VarScene" - }, - "parameters": [ - "shape", - "=", - "0" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "VarScene" - }, - "parameters": [ - "shape", - "=", - "2" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "VarScene" - }, - "parameters": [ - "shape", - "=", - "4" - ], - "subInstructions": [] - } + "parameters": [ + "BarSelect", + "", + "" ] } ], "actions": [ { "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "Shapes[VariableString(Shapes.Size)].FillColor.R", - "=", - "Variable(R)" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "Shapes[VariableString(Shapes.Size)].FillColor.G", - "=", - "Variable(G)" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "Shapes[VariableString(Shapes.Size)].FillColor.B", - "=", - "Variable(B)" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "Shapes[VariableString(Shapes.Size)].FillOpacity", - "=", - "Variable(A)" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "ModVarScene" + "value": "SetBooleanVariable" }, "parameters": [ - "Shapes[VariableString(Shapes.Size)].BorderOpacity", - "=", - "0" - ], - "subInstructions": [] + "canDraw", + "False", + "" + ] }, { "type": { - "inverted": false, - "value": "ModVarScene" + "value": "SetBooleanObjectVariable" }, "parameters": [ - "Shapes[VariableString(Shapes.Size)].Thickness", - "=", - "2" - ], - "subInstructions": [] + "BarSelect", + "isDragged", + "True", + "" + ] } - ], - "events": [] - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Circle Border", - "comment2": "" + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -1516,478 +1475,579 @@ "textG": 0, "textR": 0 }, - "comment": "Rectangle Border", - "comment2": "" + "comment": "In case the value of canDraw is true that means the pointer is NOT over the gui element so we can start drawing the selected shape as we move the mouse\nIn order to draw a shape, the drawer object going to need some initial values such as start position of drawing, shape, shape size" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, - "value": "BuiltinCommonInstructions::Or" + "value": "BooleanVariable" }, - "parameters": [], - "subInstructions": [ - { - "type": { - "inverted": false, - "value": "VarScene" - }, - "parameters": [ - "shape", - "=", - "1" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "VarScene" - }, - "parameters": [ - "shape", - "=", - "3" - ], - "subInstructions": [] - } + "parameters": [ + "canDraw", + "True", + "" ] } ], "actions": [ { "type": { - "inverted": false, - "value": "ModVarScene" + "value": "SetBooleanVariable" }, "parameters": [ - "Shapes[VariableString(Shapes.Size)].FillOpacity", - "=", - "0" - ], - "subInstructions": [] + "isDrawing", + "True", + "" + ] }, { "type": { - "inverted": false, - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "Shapes[VariableString(Shapes.Size)].BorderColor.R", - "=", - "Variable(R)" - ], - "subInstructions": [] + "Shapes.Size", + "+", + "1" + ] }, { "type": { - "inverted": false, - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "Shapes[VariableString(Shapes.Size)].BorderColor.G", + "Shapes[VariableString(Shapes.Size)].Type", "=", - "Variable(G)" - ], - "subInstructions": [] + "Variable(shape)" + ] }, { "type": { - "inverted": false, - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "Shapes[VariableString(Shapes.Size)].BorderColor.B", + "Shapes[VariableString(Shapes.Size)].StartX", "=", - "Variable(B)" - ], - "subInstructions": [] + "MouseX(\"\",0)" + ] }, { "type": { - "inverted": false, - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "Shapes[VariableString(Shapes.Size)].BorderOpacity", + "Shapes[VariableString(Shapes.Size)].StartY", "=", - "Variable(A)" + "MouseY(\"\",0)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The shape painter object has properties that we also need to set such as RGB color values, opacity and border. We set these values here and store them in variables for each different shape we can draw" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Circle Filled" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Rectangle Filled" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Line" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "shape", + "=", + "0" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "shape", + "=", + "2" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "shape", + "=", + "4" + ] + } + ] + } ], - "subInstructions": [] + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Shapes[VariableString(Shapes.Size)].FillColor.R", + "=", + "VariableString(R)" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Shapes[VariableString(Shapes.Size)].FillColor.G", + "=", + "VariableString(G)" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Shapes[VariableString(Shapes.Size)].FillColor.B", + "=", + "VariableString(B)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Shapes[VariableString(Shapes.Size)].FillOpacity", + "=", + "Variable(A)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Shapes[VariableString(Shapes.Size)].BorderOpacity", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Shapes[VariableString(Shapes.Size)].Thickness", + "=", + "2" + ] + } + ] }, { - "type": { - "inverted": false, - "value": "ModVarScene" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "Shapes[VariableString(Shapes.Size)].Border", - "=", - "2" + "comment": "Circle Border" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Rectangle Border" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "shape", + "=", + "1" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "shape", + "=", + "3" + ] + } + ] + } ], - "subInstructions": [] + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Shapes[VariableString(Shapes.Size)].FillOpacity", + "=", + "0" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Shapes[VariableString(Shapes.Size)].BorderColor.R", + "=", + "VariableString(R)" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Shapes[VariableString(Shapes.Size)].BorderColor.G", + "=", + "VariableString(G)" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Shapes[VariableString(Shapes.Size)].BorderColor.B", + "=", + "VariableString(B)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Shapes[VariableString(Shapes.Size)].BorderOpacity", + "=", + "Variable(A)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Shapes[VariableString(Shapes.Size)].Border", + "=", + "2" + ] + } + ] } - ], - "events": [] + ] } ] - } - ] - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "If the pointer is down and the bar is selected BarSelect = 1, move the bar", - "comment2": "" - }, - { - "disabled": false, - "folded": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { - "type": { - "inverted": false, - "value": "VarObjet" - }, - "parameters": [ - "BarSelect", - "Drag", - "=", - "1" - ], - "subInstructions": [] - } - ], - "actions": [ - { - "type": { - "inverted": false, - "value": "MettreX" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "BarSelect", - "=", - "MouseX(\"\",0)" - ], - "subInstructions": [] - } - ], - "events": [ - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": false, - "value": "PosX" - }, - "parameters": [ - "BarSelect", - "<", - "50" - ], - "subInstructions": [] - } - ], - "actions": [ - { - "type": { - "inverted": false, - "value": "MettreX" - }, - "parameters": [ - "BarSelect", - "=", - "50" - ], - "subInstructions": [] - } - ], - "events": [] + "comment": "If the pointer is down and the bar is selected BarSelect isDragged = true, move the bar" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, - "value": "PosX" + "value": "BooleanObjectVariable" }, "parameters": [ "BarSelect", - ">", - "305" - ], - "subInstructions": [] + "isDragged", + "True", + "" + ] } ], "actions": [ { "type": { - "inverted": false, "value": "MettreX" }, "parameters": [ "BarSelect", "=", - "305" - ], - "subInstructions": [] - } - ], - "events": [] - }, - { - "disabled": false, - "folded": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "inverted": false, - "value": "ModVarObjet" - }, - "parameters": [ - "BarSelect", - "Value", - "=", - "BarSelect.X()-50" - ], - "subInstructions": [] + "MouseX(\"\",0)" + ] } ], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, - "value": "VarObjet" + "value": "PosX" }, "parameters": [ "BarSelect", - "ID", - "=", - "0" - ], - "subInstructions": [] + "<", + "50" + ] } ], "actions": [ { "type": { - "inverted": false, - "value": "ModVarScene" + "value": "MettreX" }, "parameters": [ - "R", + "BarSelect", "=", - "BarSelect.Variable(Value)" - ], - "subInstructions": [] + "50" + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, - "value": "VarObjet" + "value": "PosX" }, "parameters": [ "BarSelect", - "ID", - "=", - "1" - ], - "subInstructions": [] + ">", + "305" + ] } ], "actions": [ { "type": { - "inverted": false, - "value": "ModVarScene" + "value": "MettreX" }, "parameters": [ - "G", + "BarSelect", "=", - "BarSelect.Variable(Value)" - ], - "subInstructions": [] + "305" + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "inverted": false, - "value": "VarObjet" + "value": "SetNumberObjectVariable" }, "parameters": [ "BarSelect", - "ID", + "Value", "=", - "2" - ], - "subInstructions": [] + "floor(BarSelect.X()-50)" + ] } ], - "actions": [ + "events": [ { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "B", - "=", - "BarSelect.Variable(Value)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "BarSelect", + "ID", + "=", + "0" + ] + } ], - "subInstructions": [] - } - ], - "events": [] - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "R", + "=", + "ToString(BarSelect.Variable(Value))" + ] + } + ] + }, { - "type": { - "inverted": false, - "value": "VarObjet" - }, - "parameters": [ - "BarSelect", - "ID", - "=", - "3" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "BarSelect", + "ID", + "=", + "1" + ] + } ], - "subInstructions": [] - } - ], - "actions": [ + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "G", + "=", + "ToString(BarSelect.Variable(Value))" + ] + } + ] + }, { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "A", - "=", - "BarSelect.Variable(Value)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "BarSelect", + "ID", + "=", + "2" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "B", + "=", + "ToString(BarSelect.Variable(Value))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "BarSelect", + "ID", + "=", + "3" + ] + } ], - "subInstructions": [] + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "A", + "=", + "BarSelect.Variable(Value)" + ] + } + ] } - ], - "events": [] + ] } ] - } - ] - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "If the pointer is down and the value of drawing = 1 then we can start drawing", - "comment2": "" - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": false, - "value": "VarScene" - }, - "parameters": [ - "drawing", - "=", - "1" - ], - "subInstructions": [] - } - ], - "actions": [], - "events": [ - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Before we can start drawing, we need to initialize some more values\nIn case of circle we need to set the radius", - "comment2": "" - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Circle Filled", - "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -1997,405 +2057,228 @@ "textG": 0, "textR": 0 }, - "comment": "Circle Border", - "comment2": "" + "comment": "If the pointer is down and the value of isDrawing = true then we can start drawing" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, - "value": "BuiltinCommonInstructions::Or" + "value": "BooleanVariable" }, - "parameters": [], - "subInstructions": [ - { - "type": { - "inverted": false, - "value": "VarScene" - }, - "parameters": [ - "shape", - "=", - "0" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "VarScene" - }, - "parameters": [ - "shape", - "=", - "1" - ], - "subInstructions": [] - } + "parameters": [ + "isDrawing", + "True", + "" ] } ], - "actions": [ + "actions": [], + "events": [ { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "Shapes[VariableString(Shapes.Size)].Radius", - "=", - "sqrt( pow(MouseX(\"\",0)-Variable(Shapes[VariableString(Shapes.Size)].StartX), 2) + pow(MouseY(\"\",0)-Variable(Shapes[VariableString(Shapes.Size)].StartY), 2) )" - ], - "subInstructions": [] - } - ], - "events": [] - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "In case of rectangle and line we need to set the end point of the shape", - "comment2": "" - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Rectangle Filled", - "comment2": "" - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Rectangle Border", - "comment2": "" - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Line", - "comment2": "" - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Before we can start drawing, we need to initialize some more values\nIn case of circle we need to set the radius" + }, { - "type": { - "inverted": false, - "value": "BuiltinCommonInstructions::Or" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [], - "subInstructions": [ + "comment": "Circle Filled" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Circle Border" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "shape", + "=", + "0" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "shape", + "=", + "1" + ] + } + ] + } + ], + "actions": [ { "type": { - "inverted": false, - "value": "VarScene" + "value": "SetNumberVariable" }, "parameters": [ - "shape", + "Shapes[VariableString(Shapes.Size)].Radius", "=", - "2" - ], - "subInstructions": [] - }, + "sqrt( pow(MouseX(\"\",0)-Variable(Shapes[VariableString(Shapes.Size)].StartX), 2) + pow(MouseY(\"\",0)-Variable(Shapes[VariableString(Shapes.Size)].StartY), 2) )" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "In case of rectangle and line we need to set the end point of the shape" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Rectangle Filled" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Rectangle Border" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Line" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "shape", + "=", + "2" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "shape", + "=", + "3" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "shape", + "=", + "4" + ] + } + ] + } + ], + "actions": [ { "type": { - "inverted": false, - "value": "VarScene" + "value": "SetNumberVariable" }, "parameters": [ - "shape", + "Shapes[VariableString(Shapes.Size)].EndX", "=", - "3" - ], - "subInstructions": [] + "MouseX(\"\",0)" + ] }, { "type": { - "inverted": false, - "value": "VarScene" + "value": "SetNumberVariable" }, "parameters": [ - "shape", + "Shapes[VariableString(Shapes.Size)].EndY", "=", - "4" - ], - "subInstructions": [] + "MouseY(\"\",0)" + ] } ] - } - ], - "actions": [ - { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "Shapes[VariableString(Shapes.Size)].EndX", - "=", - "MouseX(\"\",0)" - ], - "subInstructions": [] }, { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "Shapes[VariableString(Shapes.Size)].EndY", - "=", - "MouseY(\"\",0)" - ], - "subInstructions": [] + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] } - ], - "events": [] - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [], - "events": [] + ] } ] - } - ] - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "If the pointer is no longer down, stop drawing", - "comment2": "" - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "SourisBouton" - }, - "parameters": [ - "", - "Left" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [], - "subInstructions": [] - } - ], - "actions": [ - { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "drawing", - "=", - "0" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "ModVarObjet" - }, - "parameters": [ - "BarSelect", - "Drag", - "=", - "0" - ], - "subInstructions": [] - } - ], - "events": [] - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Reset the counter used to pick shape number", - "comment2": "" - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "inverted": false, - "value": "ModVarScene" - }, - "parameters": [ - "i", - "=", - "0" - ], - "subInstructions": [] - } - ], - "events": [] - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Repeat = the size of the rectangle struct (+1 because I like the struct start with 0)\n-draw the rectangle in the struct with index = i\n-add 1 to i\nWe apply all the properties now on the drawer object based on what shape we picked to draw, what color and opacity", - "comment2": "" - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "Variable(Shapes.Size)+1", - "conditions": [], - "actions": [ - { - "type": { - "inverted": false, - "value": "PrimitiveDrawing::FillColor" - }, - "parameters": [ - "Drawer", - "VariableString(Shapes[VariableString(i)].FillColor.R)+\";\"+VariableString(Shapes[VariableString(i)].FillColor.G)+\";\"+VariableString(Shapes[VariableString(i)].FillColor.B)" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "PrimitiveDrawing::FillOpacity" - }, - "parameters": [ - "Drawer", - "=", - "Variable(Shapes[VariableString(i)].FillOpacity)" - ], - "subInstructions": [] }, { - "type": { - "inverted": false, - "value": "PrimitiveDrawing::OutlineColor" - }, - "parameters": [ - "Drawer", - "VariableString(Shapes[VariableString(i)].BorderColor.R)+\";\"+VariableString(Shapes[VariableString(i)].BorderColor.G)+\";\"+VariableString(Shapes[VariableString(i)].BorderColor.B)" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "PrimitiveDrawing::OutlineOpacity" - }, - "parameters": [ - "Drawer", - "=", - "Variable(Shapes[VariableString(i)].BorderOpacity)" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "PrimitiveDrawing::OutlineSize" - }, - "parameters": [ - "Drawer", - "=", - "Variable(Shapes[VariableString(i)].Border)" - ], - "subInstructions": [] - } - ], - "events": [ - { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -2405,68 +2288,53 @@ "textG": 0, "textR": 0 }, - "comment": "Draw the circle if the circle is picked shape 0 and 1", - "comment2": "" + "comment": "If the pointer is no longer down, stop drawing" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, - "value": "BuiltinCommonInstructions::Or" + "inverted": true, + "value": "SourisBouton" }, - "parameters": [], - "subInstructions": [ - { - "type": { - "inverted": false, - "value": "VarScene" - }, - "parameters": [ - "Shapes[VariableString(i)].Type", - "=", - "0" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "VarScene" - }, - "parameters": [ - "Shapes[VariableString(i)].Type", - "=", - "1" - ], - "subInstructions": [] - } + "parameters": [ + "", + "Left" ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] } ], "actions": [ { "type": { - "inverted": false, - "value": "PrimitiveDrawing::Circle" + "value": "SetBooleanVariable" + }, + "parameters": [ + "isDrawing", + "False", + "" + ] + }, + { + "type": { + "value": "SetBooleanObjectVariable" }, "parameters": [ - "Drawer", - "Variable(Shapes[VariableString(i)].StartX)", - "Variable(Shapes[VariableString(i)].StartY)", - "Variable(Shapes[VariableString(i)].Radius)" - ], - "subInstructions": [] + "BarSelect", + "isDragged", + "False", + "" + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -2476,69 +2344,25 @@ "textG": 0, "textR": 0 }, - "comment": "Draw the rectangle if the rectangle is picked shape: 2 and 3", - "comment2": "" + "comment": "Reset the counter used to pick shape number" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": false, - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "inverted": false, - "value": "VarScene" - }, - "parameters": [ - "Shapes[VariableString(i)].Type", - "=", - "2" - ], - "subInstructions": [] - }, - { - "type": { - "inverted": false, - "value": "VarScene" - }, - "parameters": [ - "Shapes[VariableString(i)].Type", - "=", - "3" - ], - "subInstructions": [] - } - ] - } - ], + "conditions": [], "actions": [ { "type": { - "inverted": false, - "value": "PrimitiveDrawing::Rectangle" + "value": "ModVarScene" }, "parameters": [ - "Drawer", - "Variable(Shapes[VariableString(i)].StartX)", - "Variable(Shapes[VariableString(i)].StartY)", - "Variable(Shapes[VariableString(i)].EndX)", - "Variable(Shapes[VariableString(i)].EndY)" - ], - "subInstructions": [] + "i", + "=", + "0" + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -2548,77 +2372,250 @@ "textG": 0, "textR": 0 }, - "comment": "Draw the line if the line is picked shape: 4", - "comment2": "" + "comment": "Repeat = the size of the rectangle struct (+1 because I like the struct start with 0)\n-draw the rectangle in the struct with index = i\n-add 1 to i\nWe apply all the properties now on the drawer object based on what shape we picked to draw, what color and opacity" }, { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "Variable(Shapes.Size)+1", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::FillColor" + }, + "parameters": [ + "Drawer", + "VariableString(Shapes[VariableString(i)].FillColor.R)+\";\"+VariableString(Shapes[VariableString(i)].FillColor.G)+\";\"+VariableString(Shapes[VariableString(i)].FillColor.B)" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::FillOpacity" + }, + "parameters": [ + "Drawer", + "=", + "Variable(Shapes[VariableString(i)].FillOpacity)" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::OutlineColor" + }, + "parameters": [ + "Drawer", + "VariableString(Shapes[VariableString(i)].BorderColor.R)+\";\"+VariableString(Shapes[VariableString(i)].BorderColor.G)+\";\"+VariableString(Shapes[VariableString(i)].BorderColor.B)" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::OutlineOpacity" + }, + "parameters": [ + "Drawer", + "=", + "Variable(Shapes[VariableString(i)].BorderOpacity)" + ] + }, { "type": { - "inverted": false, - "value": "BuiltinCommonInstructions::Or" + "value": "PrimitiveDrawing::OutlineSize" + }, + "parameters": [ + "Drawer", + "=", + "Variable(Shapes[VariableString(i)].Border)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [], - "subInstructions": [ + "comment": "Draw the circle if the circle is picked shape 0 and 1" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "inverted": false, - "value": "VarScene" + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Shapes[VariableString(i)].Type", + "=", + "0" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Shapes[VariableString(i)].Type", + "=", + "1" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::Circle" }, "parameters": [ - "Shapes[VariableString(i)].Type", - "=", - "4" - ], - "subInstructions": [] + "Drawer", + "Variable(Shapes[VariableString(i)].StartX)", + "Variable(Shapes[VariableString(i)].StartY)", + "Variable(Shapes[VariableString(i)].Radius)" + ] } ] - } - ], - "actions": [ + }, { - "type": { - "inverted": false, - "value": "PrimitiveDrawing::Line" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "Drawer", - "Variable(Shapes[VariableString(i)].StartX)", - "Variable(Shapes[VariableString(i)].StartY)", - "Variable(Shapes[VariableString(i)].EndX)", - "Variable(Shapes[VariableString(i)].EndY)", - "Variable(Shapes[VariableString(i)].Thickness)" + "comment": "Draw the rectangle if the rectangle is picked shape: 2 and 3" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Shapes[VariableString(i)].Type", + "=", + "2" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Shapes[VariableString(i)].Type", + "=", + "3" + ] + } + ] + } ], - "subInstructions": [] - } - ], - "events": [] - }, - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::Rectangle" + }, + "parameters": [ + "Drawer", + "Variable(Shapes[VariableString(i)].StartX)", + "Variable(Shapes[VariableString(i)].StartY)", + "Variable(Shapes[VariableString(i)].EndX)", + "Variable(Shapes[VariableString(i)].EndY)" + ] + } + ] + }, { - "type": { - "inverted": false, - "value": "ModVarScene" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "i", - "+", - "1" + "comment": "Draw the line if the line is picked shape: 4" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Shapes[VariableString(i)].Type", + "=", + "4" + ] + } + ] + } ], - "subInstructions": [] + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::Line" + }, + "parameters": [ + "Drawer", + "Variable(Shapes[VariableString(i)].StartX)", + "Variable(Shapes[VariableString(i)].StartY)", + "Variable(Shapes[VariableString(i)].EndX)", + "Variable(Shapes[VariableString(i)].EndY)", + "Variable(Shapes[VariableString(i)].Thickness)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "i", + "+", + "1" + ] + } + ] } - ], - "events": [] + ] } - ] + ], + "parameters": [] } ], "layers": [ @@ -2626,9 +2623,15 @@ "ambientLightColorB": 200, "ambientLightColorG": 200, "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", "followBaseLayerCamera": false, "isLightingLayer": false, + "isLocked": false, "name": "", + "renderingType": "", "visibility": true, "cameras": [ { @@ -2645,7 +2648,36 @@ "effects": [] } ], - "behaviorsSharedData": [] + "behaviorsSharedData": [ + { + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" + }, + { + "name": "Effect", + "type": "EffectCapability::EffectBehavior" + }, + { + "name": "Flippable", + "type": "FlippableCapability::FlippableBehavior" + }, + { + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" + }, + { + "name": "Resizable", + "type": "ResizableCapability::ResizableBehavior" + }, + { + "name": "Scale", + "type": "ScalableCapability::ScalableBehavior" + }, + { + "name": "Text", + "type": "TextContainerCapability::TextContainerBehavior" + } + ] } ], "externalEvents": [],