From f5f2a11f65924ce99fcd39b0a712a5ef78d0350c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Sun, 18 Dec 2022 11:26:09 +0100 Subject: [PATCH] [Recolorizer] Add a scene to recolorize a pixel-art sprite. --- examples/recolorizer/assets/Ship 4.png | Bin 0 -> 714 bytes examples/recolorizer/recolorizer.json | 5821 ++++++++++++++---------- 2 files changed, 3330 insertions(+), 2491 deletions(-) create mode 100644 examples/recolorizer/assets/Ship 4.png diff --git a/examples/recolorizer/assets/Ship 4.png b/examples/recolorizer/assets/Ship 4.png new file mode 100644 index 0000000000000000000000000000000000000000..0bd90345a0491d28484d26b4592d3d95dceacd3c GIT binary patch literal 714 zcmV;*0yX`KP)8nu6a`@E4RqT&Ho8>^prBi)%qa+X_TVL37Ns8jgHS=cI73Ch zfGv(KkR{08!QBfadZ?a5QnKZ^?b16$k@)4@Ybs_G`4W*NYAeQV)UAJm$5G-}+@<$) z0Ac{~e@P(#Nf*3IQ(>b#XSk&4yJH~6Iz;jUh{SK}dx_+P;0nK7*58udoDu*7v}QyA zvinR9AmF;LZxGP{-v-YE$n!6C{fl!tz-BHW4`9FmMl1u!{id8i0(?&m0~le__XJoV zkUW61uMPNg7eFp8=sn0_2bS_MY5+%A;uDU=tgn9(Jl{+VZWGMJAuxgi(gotdRRa(- zSnWWyiSp!_)Y6uXqCEyTm045ID zQgKEHSOKWQI$&)zS0Cl93-07p4OiB-Ak7Nge&+fQJSk`CsXE^W<4hatBW|rVdNw`^ z7=eIeAkB1vm5tU2u%+&_Fnhq-JzzYj2qe>b9~m=bEA__57T# zm%x2dTcA-G2(<(JpF|G_UUR7^`SXJVZiL7UK@iJAhZ-{30e@yRK)2NZ|J_56()H>$ z>r;1I_zph8^^*Mn4&R(Ih;Wn0Q?K{YW|wJ114| wv96y+N%W`sA7G678xWE1p&h+E(hrCK4PW_!zLEmNT>t<807*qoM6N<$f)|=OaR2}S literal 0 HcmV?d00001 diff --git a/examples/recolorizer/recolorizer.json b/examples/recolorizer/recolorizer.json index 0ec42925e..f037309ac 100644 --- a/examples/recolorizer/recolorizer.json +++ b/examples/recolorizer/recolorizer.json @@ -15,6 +15,7 @@ "projectUuid": "c6d6d726-77f4-4936-8eca-1566023848c5", "scaleMode": "linear", "sizeOnStartupMode": "", + "templateSlug": "", "useExternalSourceFiles": false, "version": "1.0.0", "name": "Recolorizer", @@ -174,6 +175,19 @@ "identifier": "https://resources.gdevelop-app.com/assets/GDevelop examples/Platformer/Player/Red hero_Idle_4.png", "name": "gdevelop-asset-store" } + }, + { + "alwaysLoaded": false, + "file": "assets/Ship 4.png", + "kind": "image", + "metadata": "", + "name": "Ship 4.png", + "smoothed": false, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Space Shooter by Pixel boy/Ship/307ae1d28cf447d73ba85fa92570b9331cac6499ffbedff4da71fefba868101e_Ship 4.png", + "name": "Ship 4.png" + } } ], "resourceFolders": [] @@ -187,9 +201,6 @@ "disableInputWhenNotFocused": true, "mangledName": "Composition", "name": "Composition", - "oglFOV": 90, - "oglZFar": 500, - "oglZNear": 1, "r": 209, "standardSortMethod": true, "stopSoundsOnStartup": true, @@ -216,7 +227,6 @@ "customSize": true, "height": 600, "layer": "Background", - "locked": false, "name": "DesertBackground", "persistentUuid": "2802b6fb-e568-46df-aedd-1b1fbd5302ef", "width": 800, @@ -232,7 +242,6 @@ "customSize": true, "height": 260, "layer": "", - "locked": false, "name": "Tree", "persistentUuid": "50a28a2c-4509-4fa4-bd40-90436b323acc", "width": 294, @@ -248,7 +257,6 @@ "customSize": false, "height": 260, "layer": "", - "locked": false, "name": "Tree", "persistentUuid": "9d5d3230-a4c0-496b-a1a4-306a3685bcc0", "width": 294, @@ -264,7 +272,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "RedHero", "persistentUuid": "52dba97e-b57a-40e3-ac3f-03e5f1419c1a", "width": 0, @@ -280,7 +287,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "Direction", "persistentUuid": "24fdb31e-ec66-466e-aa6c-e1040d76f8b8", "width": 0, @@ -294,6 +300,7 @@ ], "objects": [ { + "assetStoreId": "", "name": "Tree", "tags": "", "type": "Sprite", @@ -339,6 +346,7 @@ ] }, { + "assetStoreId": "", "name": "DesertBackground", "tags": "", "type": "Sprite", @@ -384,6 +392,7 @@ ] }, { + "assetStoreId": "", "name": "RedHero", "tags": "", "type": "Sprite", @@ -480,6 +489,7 @@ ] }, { + "assetStoreId": "", "bold": false, "italic": false, "name": "Direction", @@ -492,6 +502,7 @@ "behaviors": [], "string": "[Enter] Toogle colorization\n[R] randomize colors\n[Space] go to the next scene", "font": "", + "textAlignment": "", "characterSize": 20, "color": { "b": 0, @@ -502,71 +513,56 @@ ], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "KeyReleased" }, "parameters": [ "", "Space" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "Scene" }, "parameters": [ "", "\"Sprite recolorization\"", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "KeyReleased" }, "parameters": [ "", "Return" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "ToggleSceneVariableAsBoolean" }, "parameters": [ "Recolorized" - ], - "subInstructions": [] + ] } ], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -580,71 +576,57 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::ResetColor" }, "parameters": [ "RedHero", "SpriteRecolorizer", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::ResetColor" }, "parameters": [ "Tree", "Recolorizer", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::ResetColor" }, "parameters": [ "DesertBackground", "SpriteRecolorizer", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "SceneVariableAsBoolean" }, "parameters": [ "Recolorized", "True" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::Recolorize" }, "parameters": [ @@ -656,12 +638,10 @@ "100", "100", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::Recolorize" }, "parameters": [ @@ -673,12 +653,10 @@ "100", "100", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::Recolorize" }, "parameters": [ @@ -690,12 +668,10 @@ "100", "100", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::Recolorize" }, "parameters": [ @@ -707,12 +683,10 @@ "100", "100", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::Recolorize" }, "parameters": [ @@ -724,17 +698,13 @@ "100", "100", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -748,78 +718,62 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "KeyReleased" }, "parameters": [ "", "r" - ], - "subInstructions": [] + ] } ], "actions": [], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::ResetColor" }, "parameters": [ "RedHero", "SpriteRecolorizer", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::ResetColor" }, "parameters": [ "Tree", "Recolorizer", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::ResetColor" }, "parameters": [ "DesertBackground", "SpriteRecolorizer", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::Recolorize" }, "parameters": [ @@ -831,12 +785,10 @@ "100", "100", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::Recolorize" }, "parameters": [ @@ -848,12 +800,10 @@ "100", "100", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::Recolorize" }, "parameters": [ @@ -865,12 +815,10 @@ "100", "100", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::Recolorize" }, "parameters": [ @@ -882,12 +830,10 @@ "100", "100", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::Recolorize" }, "parameters": [ @@ -899,11 +845,9 @@ "100", "100", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ] } @@ -959,9 +903,6 @@ "disableInputWhenNotFocused": true, "mangledName": "Sprite_32recolorization", "name": "Sprite recolorization", - "oglFOV": 90, - "oglZFar": 500, - "oglZNear": 1, "r": 71, "standardSortMethod": true, "stopSoundsOnStartup": true, @@ -1012,7 +953,6 @@ "customSize": true, "height": 260, "layer": "", - "locked": false, "name": "Tree", "persistentUuid": "c45c47b1-b250-4157-958d-df790fba37fb", "width": 314, @@ -1028,7 +968,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "FoliageHueSlider", "persistentUuid": "45e9562f-9c55-47c0-8213-698931690048", "width": 0, @@ -1044,7 +983,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "TrunkHueSlider", "persistentUuid": "dfadf8b4-cb8f-43dd-9d1d-6763ded7cd8c", "width": 0, @@ -1060,7 +998,6 @@ "customSize": true, "height": 32, "layer": "", - "locked": false, "name": "Spectrum", "persistentUuid": "775bb2a7-d0bb-4963-9b65-a39793a8f958", "width": 256, @@ -1076,7 +1013,6 @@ "customSize": true, "height": 32, "layer": "", - "locked": false, "name": "Spectrum", "persistentUuid": "c873d835-4412-48e0-9f49-10e4a866e727", "width": 256, @@ -1092,7 +1028,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "TrunkSaturationSlider", "persistentUuid": "10c06e11-739e-4587-aeec-9061b0433498", "width": 0, @@ -1108,7 +1043,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "TrunkLightnessSlider", "persistentUuid": "8f197866-4a09-483f-9948-9f461876b0ee", "width": 0, @@ -1124,7 +1058,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "FoliageSaturationSlider", "persistentUuid": "d9ce5bf5-208a-4ec5-bf5e-513ed833e2d3", "width": 0, @@ -1140,7 +1073,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "FoliageLightnessSlider", "persistentUuid": "c5ca95b6-b845-443f-8dcc-94a1242695f7", "width": 0, @@ -1156,7 +1088,6 @@ "customSize": true, "height": 260, "layer": "", - "locked": false, "name": "Tree", "persistentUuid": "126a6fc0-7d8a-476c-b614-7d461850e463", "width": 314, @@ -1172,7 +1103,6 @@ "customSize": true, "height": 260, "layer": "", - "locked": false, "name": "Tree", "persistentUuid": "82445c23-a834-41ab-9f1a-32dfe0d45149", "width": 314, @@ -1188,7 +1118,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "Direction", "persistentUuid": "8207f6f3-671d-4687-9d60-61dcb8dc3a9d", "width": 0, @@ -1202,6 +1131,7 @@ ], "objects": [ { + "assetStoreId": "", "name": "Tree", "tags": "", "type": "Sprite", @@ -1247,6 +1177,7 @@ ] }, { + "assetStoreId": "", "name": "FoliageHueSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -1304,6 +1235,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "FoliageSaturationSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -1361,6 +1293,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "FoliageLightnessSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -1418,6 +1351,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "TrunkHueSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -1475,6 +1409,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "TrunkSaturationSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -1532,6 +1467,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "TrunkLightnessSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -1589,6 +1525,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "bold": false, "italic": false, "name": "Direction", @@ -1601,6 +1538,7 @@ "behaviors": [], "string": "Press space for the next scene", "font": "", + "textAlignment": "", "characterSize": 20, "color": { "b": 0, @@ -1609,6 +1547,7 @@ } }, { + "assetStoreId": "", "name": "Spectrum", "tags": "", "type": "Sprite", @@ -1651,26 +1590,20 @@ ], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DepartScene" }, "parameters": [ "" - ], - "subInstructions": [] + ] } ], "actions": [], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -1684,14 +1617,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "ModVarObjetTxt" }, "parameters": [ @@ -1699,12 +1629,10 @@ "FoliageColor", "=", "\"170;189;48\"" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjetTxt" }, "parameters": [ @@ -1712,15 +1640,11 @@ "TrunkColor", "=", "\"174;112;62\"" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -1734,14 +1658,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -1749,12 +1670,10 @@ "DraggableSliderControl", "ColorConversion::Hue(Tree.VariableString(FoliageColor))", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -1762,12 +1681,10 @@ "DraggableSliderControl", "ColorConversion::Saturation(Tree.VariableString(FoliageColor))", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -1775,12 +1692,10 @@ "DraggableSliderControl", "ColorConversion::Lightness(Tree.VariableString(FoliageColor))", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -1788,12 +1703,10 @@ "DraggableSliderControl", "ColorConversion::Hue(Tree.VariableString(TrunkColor))", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -1801,12 +1714,10 @@ "DraggableSliderControl", "ColorConversion::Saturation(Tree.VariableString(TrunkColor))", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -1814,15 +1725,11 @@ "DraggableSliderControl", "ColorConversion::Lightness(Tree.VariableString(TrunkColor))", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -1836,14 +1743,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -1851,12 +1755,10 @@ "FoliageHue", "=", "FoliageHueSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -1864,12 +1766,10 @@ "FoliageSaturation", "=", "FoliageSaturationSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -1877,12 +1777,10 @@ "FoliageLightness", "=", "FoliageLightnessSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -1890,12 +1788,10 @@ "TrunkHue", "=", "TrunkHueSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -1903,12 +1799,10 @@ "TrunkSaturation", "=", "TrunkSaturationSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -1916,15 +1810,11 @@ "TrunkLightness", "=", "TrunkLightnessSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -1938,86 +1828,69 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "AjoutHasard" }, "parameters": [ "", "Tree" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "SetObjectVariableAsBoolean" }, "parameters": [ "Tree", "IsSelected", "True" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::IsBeingDragged" }, "parameters": [ "Slider", "DraggableSliderControl", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ObjectVariableAsBoolean" }, "parameters": [ "Tree", "IsSelected", "True" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "AjoutObjConcern" }, "parameters": [ "", "Slider" - ], - "subInstructions": [] + ] } ], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -2031,14 +1904,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -2046,12 +1916,10 @@ "FoliageHue", "=", "FoliageHueSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -2059,12 +1927,10 @@ "FoliageSaturation", "=", "FoliageSaturationSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -2072,12 +1938,10 @@ "FoliageLightness", "=", "FoliageLightnessSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -2085,12 +1949,10 @@ "TrunkHue", "=", "TrunkHueSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -2098,12 +1960,10 @@ "TrunkSaturation", "=", "TrunkSaturationSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -2111,26 +1971,20 @@ "TrunkLightness", "=", "TrunkLightnessSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { "colorB": 228, "colorG": 176, "colorR": 74, "creationTime": 0, - "disabled": false, - "folded": false, "name": "Colorize the object", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -2144,26 +1998,21 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::ResetColor" }, "parameters": [ "Tree", "Recolorizer", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::Recolorize" }, "parameters": [ @@ -2175,12 +2024,10 @@ "100", "100", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::Recolorize" }, "parameters": [ @@ -2192,11 +2039,9 @@ "100", "100", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [] @@ -2204,24 +2049,19 @@ ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "MouseButtonReleased" }, "parameters": [ "", "Left" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "SourisSurObjet" }, "parameters": [ @@ -2229,15 +2069,12 @@ "", "yes", "" - ], - "subInstructions": [] + ] } ], "actions": [], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -2251,40 +2088,31 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "AjoutObjConcern" }, "parameters": [ "", "Tree" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "SetObjectVariableAsBoolean" }, "parameters": [ "Tree", "IsSelected", "False" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -2298,26 +2126,21 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "SetObjectVariableAsBoolean" }, "parameters": [ "Tree", "IsSelected", "True" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -2325,12 +2148,10 @@ "DraggableSliderControl", "Tree.Variable(FoliageHue)", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -2338,12 +2159,10 @@ "DraggableSliderControl", "Tree.Variable(FoliageSaturation)", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -2351,12 +2170,10 @@ "DraggableSliderControl", "Tree.Variable(FoliageLightness)", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -2364,12 +2181,10 @@ "DraggableSliderControl", "Tree.Variable(TrunkHue)", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -2377,12 +2192,10 @@ "DraggableSliderControl", "Tree.Variable(TrunkSaturation)", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -2390,46 +2203,37 @@ "DraggableSliderControl", "Tree.Variable(TrunkLightness)", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "KeyReleased" }, "parameters": [ "", "Space" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "Scene" }, "parameters": [ "", "\"Tiled sprite recolorization\"", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "layers": [ @@ -2472,9 +2276,6 @@ "disableInputWhenNotFocused": true, "mangledName": "Tiled_32sprite_32recolorization", "name": "Tiled sprite recolorization", - "oglFOV": 90, - "oglZFar": 500, - "oglZNear": 1, "r": 71, "standardSortMethod": true, "stopSoundsOnStartup": true, @@ -2525,7 +2326,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "GrassHueSlider", "persistentUuid": "45e9562f-9c55-47c0-8213-698931690048", "width": 0, @@ -2541,7 +2341,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "RockHueSlider", "persistentUuid": "dfadf8b4-cb8f-43dd-9d1d-6763ded7cd8c", "width": 0, @@ -2557,7 +2356,6 @@ "customSize": true, "height": 32, "layer": "", - "locked": false, "name": "Spectrum", "persistentUuid": "775bb2a7-d0bb-4963-9b65-a39793a8f958", "width": 256, @@ -2573,7 +2371,6 @@ "customSize": true, "height": 32, "layer": "", - "locked": false, "name": "Spectrum", "persistentUuid": "c873d835-4412-48e0-9f49-10e4a866e727", "width": 256, @@ -2589,7 +2386,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "RockSaturationSlider", "persistentUuid": "10c06e11-739e-4587-aeec-9061b0433498", "width": 0, @@ -2605,7 +2401,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "RockLightnessSlider", "persistentUuid": "8f197866-4a09-483f-9948-9f461876b0ee", "width": 0, @@ -2621,7 +2416,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "GrassSaturationSlider", "persistentUuid": "d9ce5bf5-208a-4ec5-bf5e-513ed833e2d3", "width": 0, @@ -2637,7 +2431,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "GrassLightnessSlider", "persistentUuid": "c5ca95b6-b845-443f-8dcc-94a1242695f7", "width": 0, @@ -2653,7 +2446,6 @@ "customSize": true, "height": 47, "layer": "", - "locked": false, "name": "Platform", "persistentUuid": "f453099a-852d-42ec-8848-d5e113f81741", "width": 384, @@ -2669,7 +2461,6 @@ "customSize": true, "height": 47, "layer": "", - "locked": false, "name": "Platform", "persistentUuid": "5368bfe2-a2cc-4775-b931-dfffba17b0d6", "width": 384, @@ -2685,7 +2476,6 @@ "customSize": true, "height": 47, "layer": "", - "locked": false, "name": "Platform", "persistentUuid": "f95035b0-47af-4df8-bc92-f3ccfc9557b4", "width": 384, @@ -2701,7 +2491,6 @@ "customSize": true, "height": 47, "layer": "", - "locked": false, "name": "Platform", "persistentUuid": "4ae246c8-4db2-4c4b-bf5d-91d94c88b332", "width": 384, @@ -2717,7 +2506,6 @@ "customSize": true, "height": 47, "layer": "", - "locked": false, "name": "Platform", "persistentUuid": "4aa821c2-8476-49d5-88f9-c6f1239a8f44", "width": 384, @@ -2733,7 +2521,6 @@ "customSize": true, "height": 47, "layer": "", - "locked": false, "name": "Platform", "persistentUuid": "d9d36877-d425-4e7d-b963-7d6646a16d93", "width": 384, @@ -2749,7 +2536,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "Direction", "persistentUuid": "b5b67c8a-52ec-4ca7-9253-2a46110ca3ab", "width": 0, @@ -2763,6 +2549,7 @@ ], "objects": [ { + "assetStoreId": "", "name": "GrassHueSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -2820,6 +2607,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "GrassSaturationSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -2877,6 +2665,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "GrassLightnessSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -2934,6 +2723,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "RockHueSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -2991,6 +2781,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "RockSaturationSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -3048,6 +2839,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "RockLightnessSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -3105,6 +2897,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "Spectrum", "tags": "", "type": "Sprite", @@ -3145,6 +2938,7 @@ ] }, { + "assetStoreId": "", "bold": false, "italic": false, "name": "Direction", @@ -3157,6 +2951,7 @@ "behaviors": [], "string": "Press space for the next scene", "font": "", + "textAlignment": "", "characterSize": 20, "color": { "b": 0, @@ -3165,6 +2960,7 @@ } }, { + "assetStoreId": "", "height": 128, "name": "Platform", "tags": "", @@ -3183,26 +2979,20 @@ ], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DepartScene" }, "parameters": [ "" - ], - "subInstructions": [] + ] } ], "actions": [], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -3216,14 +3006,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "ModVarObjetTxt" }, "parameters": [ @@ -3231,12 +3018,10 @@ "GrassColor", "=", "\"179;208;42\"" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjetTxt" }, "parameters": [ @@ -3244,15 +3029,11 @@ "RockColor", "=", "\"87;50;23\"" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -3266,14 +3047,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -3281,12 +3059,10 @@ "DraggableSliderControl", "ColorConversion::Hue(Platform.VariableString(GrassColor))", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -3294,12 +3070,10 @@ "DraggableSliderControl", "ColorConversion::Saturation(Platform.VariableString(GrassColor))", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -3307,12 +3081,10 @@ "DraggableSliderControl", "ColorConversion::Lightness(Platform.VariableString(GrassColor))", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -3320,12 +3092,10 @@ "DraggableSliderControl", "ColorConversion::Hue(Platform.VariableString(RockColor))", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -3333,12 +3103,10 @@ "DraggableSliderControl", "ColorConversion::Saturation(Platform.VariableString(RockColor))", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -3346,15 +3114,11 @@ "DraggableSliderControl", "ColorConversion::Lightness(Platform.VariableString(RockColor))", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -3368,14 +3132,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -3383,12 +3144,10 @@ "GrassHue", "=", "GrassHueSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -3396,12 +3155,10 @@ "GrassSaturation", "=", "GrassSaturationSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -3409,12 +3166,10 @@ "GrassLightness", "=", "GrassLightnessSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -3422,12 +3177,10 @@ "RockHue", "=", "RockHueSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -3435,12 +3188,10 @@ "RockSaturation", "=", "RockSaturationSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -3448,15 +3199,11 @@ "RockLightness", "=", "RockLightnessSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -3470,86 +3217,69 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "AjoutHasard" }, "parameters": [ "", "Platform" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "SetObjectVariableAsBoolean" }, "parameters": [ "Platform", "IsSelected", "True" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::IsBeingDragged" }, "parameters": [ "Slider", "DraggableSliderControl", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ObjectVariableAsBoolean" }, "parameters": [ "Platform", "IsSelected", "True" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "AjoutObjConcern" }, "parameters": [ "", "Slider" - ], - "subInstructions": [] + ] } ], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -3563,14 +3293,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -3578,12 +3305,10 @@ "GrassHue", "=", "GrassHueSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -3591,12 +3316,10 @@ "GrassSaturation", "=", "GrassSaturationSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -3604,12 +3327,10 @@ "GrassLightness", "=", "GrassLightnessSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -3617,12 +3338,10 @@ "RockHue", "=", "RockHueSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -3630,12 +3349,10 @@ "RockSaturation", "=", "RockSaturationSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -3643,26 +3360,20 @@ "RockLightness", "=", "RockLightnessSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { "colorB": 228, "colorG": 176, "colorR": 74, "creationTime": 0, - "disabled": false, - "folded": false, "name": "Colorize the object", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -3676,26 +3387,21 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "Recolorizer::TiledSpriteRecolorizer::ResetColor" }, "parameters": [ "Platform", "TiledSpriteRecolorizer", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::TiledSpriteRecolorizer::Recolorize" }, "parameters": [ @@ -3707,12 +3413,10 @@ "100", "100", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::TiledSpriteRecolorizer::Recolorize" }, "parameters": [ @@ -3724,11 +3428,9 @@ "100", "100", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [] @@ -3736,24 +3438,19 @@ ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "MouseButtonReleased" }, "parameters": [ "", "Left" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "SourisSurObjet" }, "parameters": [ @@ -3761,15 +3458,12 @@ "", "yes", "" - ], - "subInstructions": [] + ] } ], "actions": [], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -3783,40 +3477,31 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "AjoutObjConcern" }, "parameters": [ "", "Platform" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "SetObjectVariableAsBoolean" }, "parameters": [ "Platform", "IsSelected", "False" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -3830,26 +3515,21 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "SetObjectVariableAsBoolean" }, "parameters": [ "Platform", "IsSelected", "True" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -3857,12 +3537,10 @@ "DraggableSliderControl", "Platform.Variable(GrassHue)", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -3870,12 +3548,10 @@ "DraggableSliderControl", "Platform.Variable(GrassSaturation)", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -3883,12 +3559,10 @@ "DraggableSliderControl", "Platform.Variable(GrassLightness)", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -3896,12 +3570,10 @@ "DraggableSliderControl", "Platform.Variable(RockHue)", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -3909,12 +3581,10 @@ "DraggableSliderControl", "Platform.Variable(RockSaturation)", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -3922,46 +3592,37 @@ "DraggableSliderControl", "Platform.Variable(RockLightness)", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "KeyReleased" }, "parameters": [ "", "Space" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "Scene" }, "parameters": [ "", "\"Panel sprite recolorization\"", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "layers": [ @@ -4004,9 +3665,6 @@ "disableInputWhenNotFocused": true, "mangledName": "Panel_32sprite_32recolorization", "name": "Panel sprite recolorization", - "oglFOV": 90, - "oglZFar": 500, - "oglZNear": 1, "r": 71, "standardSortMethod": true, "stopSoundsOnStartup": true, @@ -4057,7 +3715,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "SnowHueSlider", "persistentUuid": "45e9562f-9c55-47c0-8213-698931690048", "width": 0, @@ -4073,7 +3730,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "RockHueSlider", "persistentUuid": "dfadf8b4-cb8f-43dd-9d1d-6763ded7cd8c", "width": 0, @@ -4089,7 +3745,6 @@ "customSize": true, "height": 32, "layer": "", - "locked": false, "name": "Spectrum", "persistentUuid": "775bb2a7-d0bb-4963-9b65-a39793a8f958", "width": 256, @@ -4105,7 +3760,6 @@ "customSize": true, "height": 32, "layer": "", - "locked": false, "name": "Spectrum", "persistentUuid": "c873d835-4412-48e0-9f49-10e4a866e727", "width": 256, @@ -4121,7 +3775,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "RockSaturationSlider", "persistentUuid": "10c06e11-739e-4587-aeec-9061b0433498", "width": 0, @@ -4137,7 +3790,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "RockLightnessSlider", "persistentUuid": "8f197866-4a09-483f-9948-9f461876b0ee", "width": 0, @@ -4153,7 +3805,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "SnowSaturationSlider", "persistentUuid": "d9ce5bf5-208a-4ec5-bf5e-513ed833e2d3", "width": 0, @@ -4169,7 +3820,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "SnowLightnessSlider", "persistentUuid": "c5ca95b6-b845-443f-8dcc-94a1242695f7", "width": 0, @@ -4185,7 +3835,6 @@ "customSize": true, "height": 160, "layer": "", - "locked": false, "name": "Platform", "persistentUuid": "3b6ac851-d143-4a24-aa97-5a0fa9d3d01c", "width": 320, @@ -4201,7 +3850,6 @@ "customSize": true, "height": 160, "layer": "", - "locked": false, "name": "Platform", "persistentUuid": "f53251f0-1432-4ce5-b049-b896e01e9a27", "width": 320, @@ -4217,7 +3865,6 @@ "customSize": true, "height": 160, "layer": "", - "locked": false, "name": "Platform", "persistentUuid": "a3174a01-4e29-4b1b-abdb-885b5a9055c4", "width": 320, @@ -4233,7 +3880,6 @@ "customSize": false, "height": 0, "layer": "", - "locked": false, "name": "Direction", "persistentUuid": "124ca3b1-dd49-4e96-b334-4faa59aeba56", "width": 0, @@ -4247,6 +3893,7 @@ ], "objects": [ { + "assetStoreId": "", "name": "SnowHueSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -4304,6 +3951,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "SnowSaturationSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -4361,6 +4009,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "SnowLightnessSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -4418,6 +4067,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "RockHueSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -4475,6 +4125,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "RockSaturationSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -4532,6 +4183,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "RockLightnessSlider", "tags": "", "type": "PrimitiveDrawing::Drawer", @@ -4589,6 +4241,7 @@ "clearBetweenFrames": true }, { + "assetStoreId": "", "name": "Spectrum", "tags": "", "type": "Sprite", @@ -4629,6 +4282,7 @@ ] }, { + "assetStoreId": "", "bottomMargin": 64, "height": 192, "leftMargin": 64, @@ -4650,6 +4304,7 @@ ] }, { + "assetStoreId": "", "bold": false, "italic": false, "name": "Direction", @@ -4662,6 +4317,7 @@ "behaviors": [], "string": "White or black areas are difficult to recolorize.\nPress space for the next scene", "font": "", + "textAlignment": "", "characterSize": 20, "color": { "b": 0, @@ -4672,26 +4328,20 @@ ], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DepartScene" }, "parameters": [ "" - ], - "subInstructions": [] + ] } ], "actions": [], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -4705,14 +4355,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "ModVarObjetTxt" }, "parameters": [ @@ -4720,12 +4367,10 @@ "SnowColor", "=", "\"213;241;255\"" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjetTxt" }, "parameters": [ @@ -4733,15 +4378,11 @@ "RockColor", "=", "\"87;50;23\"" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -4755,14 +4396,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -4770,12 +4408,10 @@ "DraggableSliderControl", "ColorConversion::Hue(Platform.VariableString(SnowColor))", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -4783,12 +4419,10 @@ "DraggableSliderControl", "ColorConversion::Saturation(Platform.VariableString(SnowColor))", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -4796,12 +4430,10 @@ "DraggableSliderControl", "ColorConversion::Lightness(Platform.VariableString(SnowColor))", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -4809,12 +4441,10 @@ "DraggableSliderControl", "ColorConversion::Hue(Platform.VariableString(RockColor))", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -4822,12 +4452,10 @@ "DraggableSliderControl", "ColorConversion::Saturation(Platform.VariableString(RockColor))", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -4835,15 +4463,11 @@ "DraggableSliderControl", "ColorConversion::Lightness(Platform.VariableString(RockColor))", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -4857,14 +4481,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -4872,12 +4493,10 @@ "SnowHue", "=", "SnowHueSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -4885,12 +4504,10 @@ "SnowSaturation", "=", "SnowSaturationSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -4898,12 +4515,10 @@ "SnowLightness", "=", "SnowLightnessSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -4911,12 +4526,10 @@ "RockHue", "=", "RockHueSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -4924,12 +4537,10 @@ "RockSaturation", "=", "RockSaturationSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -4937,15 +4548,11 @@ "RockLightness", "=", "RockLightnessSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -4959,86 +4566,69 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "AjoutHasard" }, "parameters": [ "", "Platform" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "SetObjectVariableAsBoolean" }, "parameters": [ "Platform", "IsSelected", "True" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::IsBeingDragged" }, "parameters": [ "Slider", "DraggableSliderControl", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ObjectVariableAsBoolean" }, "parameters": [ "Platform", "IsSelected", "True" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "AjoutObjConcern" }, "parameters": [ "", "Slider" - ], - "subInstructions": [] + ] } ], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -5052,14 +4642,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -5067,12 +4654,10 @@ "SnowHue", "=", "SnowHueSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -5080,12 +4665,10 @@ "SnowSaturation", "=", "SnowSaturationSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -5093,12 +4676,10 @@ "SnowLightness", "=", "SnowLightnessSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -5106,12 +4687,10 @@ "RockHue", "=", "RockHueSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -5119,12 +4698,10 @@ "RockSaturation", "=", "RockSaturationSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "ModVarObjet" }, "parameters": [ @@ -5132,26 +4709,20 @@ "RockLightness", "=", "RockLightnessSlider.DraggableSliderControl::Value()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { "colorB": 228, "colorG": 176, "colorR": 74, "creationTime": 0, - "disabled": false, - "folded": false, "name": "Colorize the object", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -5165,26 +4736,21 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "Recolorizer::PanelSpriteRecolorizer::ResetColor" }, "parameters": [ "Platform", "PanelSpriteRecolorizer", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::PanelSpriteRecolorizer::Recolorize" }, "parameters": [ @@ -5196,12 +4762,10 @@ "100", "50", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Recolorizer::PanelSpriteRecolorizer::Recolorize" }, "parameters": [ @@ -5213,11 +4777,9 @@ "100", "50", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [] @@ -5225,24 +4787,19 @@ ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "MouseButtonReleased" }, "parameters": [ "", "Left" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "SourisSurObjet" }, "parameters": [ @@ -5250,15 +4807,12 @@ "", "yes", "" - ], - "subInstructions": [] + ] } ], "actions": [], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -5272,40 +4826,31 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "AjoutObjConcern" }, "parameters": [ "", "Platform" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "SetObjectVariableAsBoolean" }, "parameters": [ "Platform", "IsSelected", "False" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -5319,26 +4864,21 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "SetObjectVariableAsBoolean" }, "parameters": [ "Platform", "IsSelected", "True" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -5346,12 +4886,10 @@ "DraggableSliderControl", "Platform.Variable(SnowHue)", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -5359,12 +4897,10 @@ "DraggableSliderControl", "Platform.Variable(SnowSaturation)", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -5372,12 +4908,10 @@ "DraggableSliderControl", "Platform.Variable(SnowLightness)", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -5385,12 +4919,10 @@ "DraggableSliderControl", "Platform.Variable(RockHue)", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -5398,12 +4930,10 @@ "DraggableSliderControl", "Platform.Variable(RockSaturation)", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -5411,46 +4941,37 @@ "DraggableSliderControl", "Platform.Variable(RockLightness)", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "KeyReleased" }, "parameters": [ "", "Space" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "Scene" }, "parameters": [ "", - "\"Composition\"", + "\"Pixel art sprite recolorization\"", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "layers": [ @@ -5487,153 +5008,1533 @@ "type": "Recolorizer::PanelSpriteRecolorizer" } ] - } - ], - "externalEvents": [], - "eventsFunctionsExtensions": [ + }, { - "author": "jeremy.leriche22@gmail.com", - "category": "", - "description": "Allows you to create a random color.\nTo use it, go in the text area to set a color and type `RandomColor::CreateRandomColor()`.", - "extensionNamespace": "", - "fullName": "Random Color Generator", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWZvcm1hdC1jb2xvci1maWxsIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTE5LDExLjVDMTksMTEuNSAxNywxMy42NyAxNywxNUEyLDIgMCAwLDAgMTksMTdBMiwyIDAgMCwwIDIxLDE1QzIxLDEzLjY3IDE5LDExLjUgMTksMTEuNU01LjIxLDEwTDEwLDUuMjFMMTQuNzksMTBNMTYuNTYsOC45NEw3LjYyLDBMNi4yMSwxLjQxTDguNTksMy43OUwzLjQ0LDguOTRDMi44NSw5LjUgMi44NSwxMC40NyAzLjQ0LDExLjA2TDguOTQsMTYuNTZDOS4yMywxNi44NSA5LjYyLDE3IDEwLDE3QzEwLjM4LDE3IDEwLjc3LDE2Ljg1IDExLjA2LDE2LjU2TDE2LjU2LDExLjA2QzE3LjE1LDEwLjQ3IDE3LjE1LDkuNSAxNi41Niw4Ljk0WiIgLz48L3N2Zz4=", - "name": "RandomColor", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/format-color-fill.svg", - "shortDescription": "Create a random color for a scene, an object, or any other color input.", - "version": "1.0.0", - "origin": { - "identifier": "RandomColor", - "name": "gdevelop-extension-store" + "b": 71, + "disableInputWhenNotFocused": true, + "mangledName": "Pixel_32art_32sprite_32recolorization", + "name": "Pixel art sprite recolorization", + "r": 71, + "standardSortMethod": true, + "stopSoundsOnStartup": true, + "title": "", + "v": 71, + "uiSettings": { + "grid": true, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": true, + "zoomFactor": 1, + "windowMask": false }, - "tags": [ - "random", - "color" - ], - "authorIds": [ - "4ng4NsgThidN4cnjobO4RdE5zKG2" - ], - "dependencies": [], - "eventsFunctions": [ + "objectsGroups": [ { - "description": "Create a totally random color.", - "fullName": "Random Color", - "functionType": "StringExpression", - "group": "", - "name": "CreateRandomColor", - "private": false, - "sentence": "", - "events": [ + "name": "Slider", + "objects": [ { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "inverted": false, - "value": "SetReturnString" - }, - "parameters": [ - "ToString(Random(255))+\";\"+ToString(Random(255))+\";\"+ToString(Random(255))" - ], - "subInstructions": [] - } - ], - "events": [] + "name": "FoliageHueSlider" + }, + { + "name": "FoliageSaturationSlider" + }, + { + "name": "FoliageLightnessSlider" + }, + { + "name": "TrunkHueSlider" + }, + { + "name": "TrunkSaturationSlider" + }, + { + "name": "TrunkLightnessSlider" } - ], - "parameters": [], - "objectGroups": [] + ] } ], - "eventsBasedBehaviors": [] - }, - { - "author": "Tristan Rhodes (https://victrisgames.itch.io/), D8H", - "category": "", - "description": "Draws a draggable slider that users can move to select a numerical value.\nThe value range, tick spacing, and the appearance of the slider can be defined with properties.\n\nHow to use:\n- Add this behavior a **Shape Painter** object\n- Place an instance of that shape painter on the screen where you want the slider to appear\n- Use the \"Value\" expression to find the Value based on the position of the slider\n\nTips:\n- You can disable the slider to prevent a user from interacting with it\n- You can set the Value of the slider and the slider will move to the correct position\n\nFurther details can be found in [this tutorial video](https://youtu.be/iiTUwdAT_hs).\n\nBreaking changes (1.0.0)\n- Track thickness and length properties replaced track width and height. These 2 properties must be set again if they were different from the default size.\n- Hidden sliders can be dragged. The \"enable\" action must be used to disable them.\n", - "extensionNamespace": "", - "fullName": "Draggable slider", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMjMiIGN5PSI3IiByPSIzIi8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMyIgeTE9IjciIHgyPSIyMCIgeTI9IjciLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyOSIgeTE9IjciIHgyPSIyNiIgeTI9IjciLz4NCjxjaXJjbGUgY2xhc3M9InN0MCIgY3g9IjEyIiBjeT0iMTYiIHI9IjMiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIzIiB5MT0iMTYiIHgyPSI5IiB5Mj0iMTYiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyOSIgeTE9IjE2IiB4Mj0iMTUiIHkyPSIxNiIvPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMjMiIGN5PSIyNSIgcj0iMyIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjMiIHkxPSIyNSIgeDI9IjIwIiB5Mj0iMjUiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyOSIgeTE9IjI1IiB4Mj0iMjYiIHkyPSIyNSIvPg0KPC9zdmc+DQo=", - "name": "DraggableSliderControl", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/UI Essentials/UI Essentials_sliders_options.svg", - "shortDescription": "A draggable slider that users can move to select a numerical value.", - "version": "1.0.1", - "origin": { - "identifier": "DraggableSliderControl", - "name": "gdevelop-extension-store" - }, - "tags": [ - "draggable", - "slider", - "shape painter", - "ui", - "widget" - ], - "authorIds": [ - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", - "gqDaZjCfevOOxBYkK6zlhtZnXCg1" - ], - "dependencies": [], - "eventsFunctions": [], - "eventsBasedBehaviors": [ + "variables": [], + "instances": [ { - "description": "Let users select a numerical value by dragging a slider.", - "fullName": "Draggable slider", - "name": "DraggableSliderControl", - "objectType": "PrimitiveDrawing::Drawer", - "eventsFunctions": [ - { - "description": "", - "fullName": "", - "functionType": "Action", - "group": "", - "name": "onCreated", - "private": false, - "sentence": "", - "events": [ - { - "disabled": false, - "folded": false, - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Make sure object doesn't get re-drawn every frame", + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "FoliageHueSlider", + "persistentUuid": "45e9562f-9c55-47c0-8213-698931690048", + "width": 0, + "x": 32, + "y": 64, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "TrunkHueSlider", + "persistentUuid": "dfadf8b4-cb8f-43dd-9d1d-6763ded7cd8c", + "width": 0, + "x": 32, + "y": 416, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 32, + "layer": "", + "name": "Spectrum", + "persistentUuid": "775bb2a7-d0bb-4963-9b65-a39793a8f958", + "width": 256, + "x": 32, + "y": 32, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 32, + "layer": "", + "name": "Spectrum", + "persistentUuid": "c873d835-4412-48e0-9f49-10e4a866e727", + "width": 256, + "x": 32, + "y": 384, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "TrunkSaturationSlider", + "persistentUuid": "10c06e11-739e-4587-aeec-9061b0433498", + "width": 0, + "x": 32, + "y": 480, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "TrunkLightnessSlider", + "persistentUuid": "8f197866-4a09-483f-9948-9f461876b0ee", + "width": 0, + "x": 32, + "y": 544, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "FoliageSaturationSlider", + "persistentUuid": "d9ce5bf5-208a-4ec5-bf5e-513ed833e2d3", + "width": 0, + "x": 32, + "y": 128, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "FoliageLightnessSlider", + "persistentUuid": "c5ca95b6-b845-443f-8dcc-94a1242695f7", + "width": 0, + "x": 32, + "y": 192, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Direction", + "persistentUuid": "8207f6f3-671d-4687-9d60-61dcb8dc3a9d", + "width": 0, + "x": 32, + "y": 265, + "zOrder": 15, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 188, + "layer": "", + "name": "Ship", + "persistentUuid": "80994869-ebce-41a6-9fd8-632da37f93ca", + "width": 256, + "x": 512, + "y": 32, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 188, + "layer": "", + "name": "Ship", + "persistentUuid": "107697ef-9235-4dce-885a-8d1f7e343370", + "width": 256, + "x": 321, + "y": 215, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 188, + "layer": "", + "name": "Ship", + "persistentUuid": "6ab740d7-1cdd-43aa-aef2-1943928adebd", + "width": 256, + "x": 512, + "y": 388, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "objects": [ + { + "assetStoreId": "", + "name": "FoliageHueSlider", + "tags": "", + "type": "PrimitiveDrawing::Drawer", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "DraggableSliderControl", + "type": "DraggableSliderControl::DraggableSliderControl", + "ValueMin": 0, + "ValueMax": 360, + "TickSpacing": 0, + "ThumbShape": "circle", + "ThumbWidth": 20, + "ThumbHeight": 20, + "ThumbColor": "175;175;175", + "ThumbOpacity": 255, + "TrackLength": 256, + "TrackThickness": 4, + "InactiveTrackColor": "", + "InactiveTrackOpacity": 96, + "ActiveTrackColor": " ", + "ActiveTrackOpacity": 255, + "HaloRadius": 24, + "HaloOpacityHover": 32, + "HaloOpacityClick": 64, + "RoundedTrack": true, + "Enabled": true, + "IsBeingDragged": false, + "Value": 0, + "ThumbOffset": 0, + "NeedRedraw": true, + "IsHovered": false, + "MouseX": 0, + "MouseY": 0, + "CurrentHaloRadius": 0, + "HaloGrowSpeed": 0.2, + "TargetHaloRadius": 0 + } + ], + "fillOpacity": 255, + "outlineSize": 1, + "outlineOpacity": 255, + "fillColor": { + "b": 255, + "g": 255, + "r": 255 + }, + "outlineColor": { + "b": 0, + "g": 0, + "r": 0 + }, + "absoluteCoordinates": false, + "clearBetweenFrames": true + }, + { + "assetStoreId": "", + "name": "FoliageSaturationSlider", + "tags": "", + "type": "PrimitiveDrawing::Drawer", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "DraggableSliderControl", + "type": "DraggableSliderControl::DraggableSliderControl", + "ValueMin": 0, + "ValueMax": 100, + "TickSpacing": 0, + "ThumbShape": "circle", + "ThumbWidth": 20, + "ThumbHeight": 20, + "ThumbColor": "175;175;175", + "ThumbOpacity": 255, + "TrackLength": 256, + "TrackThickness": 4, + "InactiveTrackColor": "", + "InactiveTrackOpacity": 96, + "ActiveTrackColor": " ", + "ActiveTrackOpacity": 255, + "HaloRadius": 24, + "HaloOpacityHover": 32, + "HaloOpacityClick": 64, + "RoundedTrack": true, + "Enabled": true, + "IsBeingDragged": false, + "Value": 0, + "ThumbOffset": 0, + "NeedRedraw": true, + "IsHovered": false, + "MouseX": 0, + "MouseY": 0, + "CurrentHaloRadius": 0, + "HaloGrowSpeed": 0.2, + "TargetHaloRadius": 0 + } + ], + "fillOpacity": 255, + "outlineSize": 1, + "outlineOpacity": 255, + "fillColor": { + "b": 255, + "g": 255, + "r": 255 + }, + "outlineColor": { + "b": 0, + "g": 0, + "r": 0 + }, + "absoluteCoordinates": false, + "clearBetweenFrames": true + }, + { + "assetStoreId": "", + "name": "FoliageLightnessSlider", + "tags": "", + "type": "PrimitiveDrawing::Drawer", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "DraggableSliderControl", + "type": "DraggableSliderControl::DraggableSliderControl", + "ValueMin": 0, + "ValueMax": 100, + "TickSpacing": 0, + "ThumbShape": "circle", + "ThumbWidth": 20, + "ThumbHeight": 20, + "ThumbColor": "175;175;175", + "ThumbOpacity": 255, + "TrackLength": 256, + "TrackThickness": 4, + "InactiveTrackColor": "", + "InactiveTrackOpacity": 96, + "ActiveTrackColor": " ", + "ActiveTrackOpacity": 255, + "HaloRadius": 24, + "HaloOpacityHover": 32, + "HaloOpacityClick": 64, + "RoundedTrack": true, + "Enabled": true, + "IsBeingDragged": false, + "Value": 0, + "ThumbOffset": 0, + "NeedRedraw": true, + "IsHovered": false, + "MouseX": 0, + "MouseY": 0, + "CurrentHaloRadius": 0, + "HaloGrowSpeed": 0.2, + "TargetHaloRadius": 0 + } + ], + "fillOpacity": 255, + "outlineSize": 1, + "outlineOpacity": 255, + "fillColor": { + "b": 255, + "g": 255, + "r": 255 + }, + "outlineColor": { + "b": 0, + "g": 0, + "r": 0 + }, + "absoluteCoordinates": false, + "clearBetweenFrames": true + }, + { + "assetStoreId": "", + "name": "TrunkHueSlider", + "tags": "", + "type": "PrimitiveDrawing::Drawer", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "DraggableSliderControl", + "type": "DraggableSliderControl::DraggableSliderControl", + "ValueMin": 0, + "ValueMax": 360, + "TickSpacing": 0, + "ThumbShape": "circle", + "ThumbWidth": 20, + "ThumbHeight": 20, + "ThumbColor": "175;175;175", + "ThumbOpacity": 255, + "TrackLength": 256, + "TrackThickness": 4, + "InactiveTrackColor": "", + "InactiveTrackOpacity": 96, + "ActiveTrackColor": " ", + "ActiveTrackOpacity": 255, + "HaloRadius": 24, + "HaloOpacityHover": 32, + "HaloOpacityClick": 64, + "RoundedTrack": true, + "Enabled": true, + "IsBeingDragged": false, + "Value": 0, + "ThumbOffset": 0, + "NeedRedraw": true, + "IsHovered": false, + "MouseX": 0, + "MouseY": 0, + "CurrentHaloRadius": 0, + "HaloGrowSpeed": 0.2, + "TargetHaloRadius": 0 + } + ], + "fillOpacity": 255, + "outlineSize": 1, + "outlineOpacity": 255, + "fillColor": { + "b": 255, + "g": 255, + "r": 255 + }, + "outlineColor": { + "b": 0, + "g": 0, + "r": 0 + }, + "absoluteCoordinates": false, + "clearBetweenFrames": true + }, + { + "assetStoreId": "", + "name": "TrunkSaturationSlider", + "tags": "", + "type": "PrimitiveDrawing::Drawer", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "DraggableSliderControl", + "type": "DraggableSliderControl::DraggableSliderControl", + "ValueMin": 0, + "ValueMax": 100, + "TickSpacing": 0, + "ThumbShape": "circle", + "ThumbWidth": 20, + "ThumbHeight": 20, + "ThumbColor": "175;175;175", + "ThumbOpacity": 255, + "TrackLength": 256, + "TrackThickness": 4, + "InactiveTrackColor": "", + "InactiveTrackOpacity": 96, + "ActiveTrackColor": " ", + "ActiveTrackOpacity": 255, + "HaloRadius": 24, + "HaloOpacityHover": 32, + "HaloOpacityClick": 64, + "RoundedTrack": true, + "Enabled": true, + "IsBeingDragged": false, + "Value": 0, + "ThumbOffset": 0, + "NeedRedraw": true, + "IsHovered": false, + "MouseX": 0, + "MouseY": 0, + "CurrentHaloRadius": 0, + "HaloGrowSpeed": 0.2, + "TargetHaloRadius": 0 + } + ], + "fillOpacity": 255, + "outlineSize": 1, + "outlineOpacity": 255, + "fillColor": { + "b": 255, + "g": 255, + "r": 255 + }, + "outlineColor": { + "b": 0, + "g": 0, + "r": 0 + }, + "absoluteCoordinates": false, + "clearBetweenFrames": true + }, + { + "assetStoreId": "", + "name": "TrunkLightnessSlider", + "tags": "", + "type": "PrimitiveDrawing::Drawer", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "DraggableSliderControl", + "type": "DraggableSliderControl::DraggableSliderControl", + "ValueMin": 0, + "ValueMax": 100, + "TickSpacing": 0, + "ThumbShape": "circle", + "ThumbWidth": 20, + "ThumbHeight": 20, + "ThumbColor": "175;175;175", + "ThumbOpacity": 255, + "TrackLength": 256, + "TrackThickness": 4, + "InactiveTrackColor": "", + "InactiveTrackOpacity": 96, + "ActiveTrackColor": " ", + "ActiveTrackOpacity": 255, + "HaloRadius": 24, + "HaloOpacityHover": 32, + "HaloOpacityClick": 64, + "RoundedTrack": true, + "Enabled": true, + "IsBeingDragged": false, + "Value": 0, + "ThumbOffset": 0, + "NeedRedraw": true, + "IsHovered": false, + "MouseX": 0, + "MouseY": 0, + "CurrentHaloRadius": 0, + "HaloGrowSpeed": 0.2, + "TargetHaloRadius": 0 + } + ], + "fillOpacity": 255, + "outlineSize": 1, + "outlineOpacity": 255, + "fillColor": { + "b": 255, + "g": 255, + "r": 255 + }, + "outlineColor": { + "b": 0, + "g": 0, + "r": 0 + }, + "absoluteCoordinates": false, + "clearBetweenFrames": true + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Direction", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "Press space for the next scene", + "font": "", + "textAlignment": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "assetStoreId": "", + "name": "Spectrum", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\Spectrum.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "d4275ec52e2a2bf5544d5777551420db4f9663f1cea00bdc8151b307c5cfdca1", + "name": "Ship", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "SpriteRecolorizer", + "type": "Recolorizer::SpriteRecolorizer" + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": true, + "timeBetweenFrames": 0.025, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Ship 4.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "This is the 2 colors that are changed using the sliders.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjetTxt" + }, + "parameters": [ + "Ship", + "FoliageColor", + "=", + "\"105;177;115\"" + ] + }, + { + "type": { + "value": "ModVarObjetTxt" + }, + "parameters": [ + "Ship", + "TrunkColor", + "=", + "\"206;136;59\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Set the slider according to the 2 initial colors.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DraggableSliderControl::DraggableSliderControl::SetValue" + }, + "parameters": [ + "FoliageHueSlider", + "DraggableSliderControl", + "ColorConversion::Hue(Ship.VariableString(FoliageColor))", + "" + ] + }, + { + "type": { + "value": "DraggableSliderControl::DraggableSliderControl::SetValue" + }, + "parameters": [ + "FoliageSaturationSlider", + "DraggableSliderControl", + "ColorConversion::Saturation(Ship.VariableString(FoliageColor))", + "" + ] + }, + { + "type": { + "value": "DraggableSliderControl::DraggableSliderControl::SetValue" + }, + "parameters": [ + "FoliageLightnessSlider", + "DraggableSliderControl", + "ColorConversion::Lightness(Ship.VariableString(FoliageColor))", + "" + ] + }, + { + "type": { + "value": "DraggableSliderControl::DraggableSliderControl::SetValue" + }, + "parameters": [ + "TrunkHueSlider", + "DraggableSliderControl", + "ColorConversion::Hue(Ship.VariableString(TrunkColor))", + "" + ] + }, + { + "type": { + "value": "DraggableSliderControl::DraggableSliderControl::SetValue" + }, + "parameters": [ + "TrunkSaturationSlider", + "DraggableSliderControl", + "ColorConversion::Saturation(Ship.VariableString(TrunkColor))", + "" + ] + }, + { + "type": { + "value": "DraggableSliderControl::DraggableSliderControl::SetValue" + }, + "parameters": [ + "TrunkLightnessSlider", + "DraggableSliderControl", + "ColorConversion::Lightness(Ship.VariableString(TrunkColor))", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Save the slider value in variable to be able to set them back when the selected object to colorize change.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Ship", + "FoliageHue", + "=", + "FoliageHueSlider.DraggableSliderControl::Value()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Ship", + "FoliageSaturation", + "=", + "FoliageSaturationSlider.DraggableSliderControl::Value()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Ship", + "FoliageLightness", + "=", + "FoliageLightnessSlider.DraggableSliderControl::Value()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Ship", + "TrunkHue", + "=", + "TrunkHueSlider.DraggableSliderControl::Value()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Ship", + "TrunkSaturation", + "=", + "TrunkSaturationSlider.DraggableSliderControl::Value()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Ship", + "TrunkLightness", + "=", + "TrunkLightnessSlider.DraggableSliderControl::Value()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Select a random object to colorize.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "AjoutHasard" + }, + "parameters": [ + "", + "Ship" + ] + }, + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Ship", + "IsSelected", + "True" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DraggableSliderControl::DraggableSliderControl::IsBeingDragged" + }, + "parameters": [ + "Slider", + "DraggableSliderControl", + "" + ] + }, + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Ship", + "IsSelected", + "True" + ] + } + ], + "actions": [ + { + "type": { + "value": "AjoutObjConcern" + }, + "parameters": [ + "", + "Slider" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Save the slider value in variable to be able to set them back when the selected object to colorize change.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Ship", + "FoliageHue", + "=", + "FoliageHueSlider.DraggableSliderControl::Value()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Ship", + "FoliageSaturation", + "=", + "FoliageSaturationSlider.DraggableSliderControl::Value()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Ship", + "FoliageLightness", + "=", + "FoliageLightnessSlider.DraggableSliderControl::Value()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Ship", + "TrunkHue", + "=", + "TrunkHueSlider.DraggableSliderControl::Value()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Ship", + "TrunkSaturation", + "=", + "TrunkSaturationSlider.DraggableSliderControl::Value()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Ship", + "TrunkLightness", + "=", + "TrunkLightnessSlider.DraggableSliderControl::Value()" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Colorize the object", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The colors need to be reset to their initial values first because the effect of the \"recolorize\" action adds up.\nThis allows to change several colors of an object.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Recolorizer::SpriteRecolorizer::ResetColor" + }, + "parameters": [ + "Ship", + "Recolorizer", + "" + ] + }, + { + "type": { + "value": "Recolorizer::SpriteRecolorizer::Recolorize" + }, + "parameters": [ + "Ship", + "SpriteRecolorizer", + "Ship.VariableString(FoliageColor)", + "ColorConversion::HslToRgb(FoliageHueSlider.DraggableSliderControl::Value(), FoliageSaturationSlider.DraggableSliderControl::Value(), FoliageLightnessSlider.DraggableSliderControl::Value())", + "45", + "100", + "25", + "" + ] + }, + { + "type": { + "value": "Recolorizer::SpriteRecolorizer::Recolorize" + }, + "parameters": [ + "Ship", + "SpriteRecolorizer", + "Ship.VariableString(TrunkColor)", + "ColorConversion::HslToRgb(TrunkHueSlider.DraggableSliderControl::Value(), TrunkSaturationSlider.DraggableSliderControl::Value(), TrunkLightnessSlider.DraggableSliderControl::Value())", + "45", + "100", + "25", + "" + ] + } + ] + } + ], + "parameters": [] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "MouseButtonReleased" + }, + "parameters": [ + "", + "Left" + ] + }, + { + "type": { + "value": "SourisSurObjet" + }, + "parameters": [ + "Ship", + "", + "yes", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Unselect the object that was colorized previously.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "AjoutObjConcern" + }, + "parameters": [ + "", + "Ship" + ] + }, + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Ship", + "IsSelected", + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Select the new object to colorize.\n\nSetup the sliders according to the last values that was used for this object.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Ship", + "IsSelected", + "True" + ] + }, + { + "type": { + "value": "DraggableSliderControl::DraggableSliderControl::SetValue" + }, + "parameters": [ + "FoliageHueSlider", + "DraggableSliderControl", + "Ship.Variable(FoliageHue)", + "" + ] + }, + { + "type": { + "value": "DraggableSliderControl::DraggableSliderControl::SetValue" + }, + "parameters": [ + "FoliageSaturationSlider", + "DraggableSliderControl", + "Ship.Variable(FoliageSaturation)", + "" + ] + }, + { + "type": { + "value": "DraggableSliderControl::DraggableSliderControl::SetValue" + }, + "parameters": [ + "FoliageLightnessSlider", + "DraggableSliderControl", + "Ship.Variable(FoliageLightness)", + "" + ] + }, + { + "type": { + "value": "DraggableSliderControl::DraggableSliderControl::SetValue" + }, + "parameters": [ + "TrunkHueSlider", + "DraggableSliderControl", + "Ship.Variable(TrunkHue)", + "" + ] + }, + { + "type": { + "value": "DraggableSliderControl::DraggableSliderControl::SetValue" + }, + "parameters": [ + "TrunkSaturationSlider", + "DraggableSliderControl", + "Ship.Variable(TrunkSaturation)", + "" + ] + }, + { + "type": { + "value": "DraggableSliderControl::DraggableSliderControl::SetValue" + }, + "parameters": [ + "TrunkLightnessSlider", + "DraggableSliderControl", + "Ship.Variable(TrunkLightness)", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyReleased" + }, + "parameters": [ + "", + "Space" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene" + }, + "parameters": [ + "", + "\"Composition\"", + "" + ] + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 32, + "ambientLightColorG": 0, + "ambientLightColorR": 0, + "followBaseLayerCamera": false, + "isLightingLayer": false, + "name": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "behaviorsSharedData": [ + { + "name": "DraggableSliderControl", + "type": "DraggableSliderControl::DraggableSliderControl" + }, + { + "name": "SpriteRecolorizer", + "type": "Recolorizer::SpriteRecolorizer" + } + ] + } + ], + "externalEvents": [], + "eventsFunctionsExtensions": [ + { + "author": "jeremy.leriche22@gmail.com", + "category": "", + "extensionNamespace": "", + "fullName": "Random Color Generator", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWZvcm1hdC1jb2xvci1maWxsIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTE5LDExLjVDMTksMTEuNSAxNywxMy42NyAxNywxNUEyLDIgMCAwLDAgMTksMTdBMiwyIDAgMCwwIDIxLDE1QzIxLDEzLjY3IDE5LDExLjUgMTksMTEuNU01LjIxLDEwTDEwLDUuMjFMMTQuNzksMTBNMTYuNTYsOC45NEw3LjYyLDBMNi4yMSwxLjQxTDguNTksMy43OUwzLjQ0LDguOTRDMi44NSw5LjUgMi44NSwxMC40NyAzLjQ0LDExLjA2TDguOTQsMTYuNTZDOS4yMywxNi44NSA5LjYyLDE3IDEwLDE3QzEwLjM4LDE3IDEwLjc3LDE2Ljg1IDExLjA2LDE2LjU2TDE2LjU2LDExLjA2QzE3LjE1LDEwLjQ3IDE3LjE1LDkuNSAxNi41Niw4Ljk0WiIgLz48L3N2Zz4=", + "name": "RandomColor", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/format-color-fill.svg", + "shortDescription": "Create a random color for a scene, an object, or any other color input.", + "version": "1.0.0", + "description": [ + "Allows you to create a random color.", + "To use it, go in the text area to set a color and type `RandomColor::CreateRandomColor()`." + ], + "origin": { + "identifier": "RandomColor", + "name": "gdevelop-extension-store" + }, + "tags": [ + "random", + "color" + ], + "authorIds": [ + "4ng4NsgThidN4cnjobO4RdE5zKG2" + ], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Create a totally random color.", + "fullName": "Random Color", + "functionType": "StringExpression", + "name": "CreateRandomColor", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "ToString(Random(255))+\";\"+ToString(Random(255))+\";\"+ToString(Random(255))" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "Tristan Rhodes (https://victrisgames.itch.io/), D8H", + "category": "", + "extensionNamespace": "", + "fullName": "Draggable slider", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMjMiIGN5PSI3IiByPSIzIi8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMyIgeTE9IjciIHgyPSIyMCIgeTI9IjciLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyOSIgeTE9IjciIHgyPSIyNiIgeTI9IjciLz4NCjxjaXJjbGUgY2xhc3M9InN0MCIgY3g9IjEyIiBjeT0iMTYiIHI9IjMiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIzIiB5MT0iMTYiIHgyPSI5IiB5Mj0iMTYiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyOSIgeTE9IjE2IiB4Mj0iMTUiIHkyPSIxNiIvPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMjMiIGN5PSIyNSIgcj0iMyIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjMiIHkxPSIyNSIgeDI9IjIwIiB5Mj0iMjUiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyOSIgeTE9IjI1IiB4Mj0iMjYiIHkyPSIyNSIvPg0KPC9zdmc+DQo=", + "name": "DraggableSliderControl", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/UI Essentials/UI Essentials_sliders_options.svg", + "shortDescription": "A draggable slider that users can move to select a numerical value.", + "version": "1.0.1", + "description": [ + "Draws a draggable slider that users can move to select a numerical value.", + "The value range, tick spacing, and the appearance of the slider can be defined with properties.", + "", + "How to use:", + "- Add this behavior a **Shape Painter** object", + "- Place an instance of that shape painter on the screen where you want the slider to appear", + "- Use the \"Value\" expression to find the Value based on the position of the slider", + "", + "Tips:", + "- You can disable the slider to prevent a user from interacting with it", + "- You can set the Value of the slider and the slider will move to the correct position", + "", + "Further details can be found in [this tutorial video](https://youtu.be/iiTUwdAT_hs).", + "", + "Breaking changes (1.0.0)", + "- Track thickness and length properties replaced track width and height. These 2 properties must be set again if they were different from the default size.", + "- Hidden sliders can be dragged. The \"enable\" action must be used to disable them.", + "" + ], + "origin": { + "identifier": "DraggableSliderControl", + "name": "gdevelop-extension-store" + }, + "tags": [ + "draggable", + "slider", + "shape painter", + "ui", + "widget" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1" + ], + "dependencies": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Let users select a numerical value by dragging a slider.", + "fullName": "Draggable slider", + "name": "DraggableSliderControl", + "objectType": "PrimitiveDrawing::Drawer", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make sure object doesn't get re-drawn every frame", "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::ClearBetweenFrames" }, "parameters": [ "Object", "no" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -5647,14 +6548,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyValue" }, "parameters": [ @@ -5662,15 +6560,11 @@ "Behavior", "=", "Object.Behavior::PropertyValueMin()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -5684,14 +6578,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyTrackThickness" }, "parameters": [ @@ -5699,15 +6590,11 @@ "Behavior", "=", "Object.Behavior::PropertyTrackThickness()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -5721,14 +6608,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyCurrentHaloRadius" }, "parameters": [ @@ -5736,52 +6620,37 @@ "Behavior", "=", "min(Object.Behavior::PropertyThumbHeight()/2,Object.Behavior::PropertyThumbWidth()/2)" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::UpdateHitbox" }, "parameters": [ "Object", "Behavior", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" } @@ -5789,12 +6658,9 @@ "objectGroups": [] }, { - "description": "", "fullName": "", "functionType": "Action", - "group": "", "name": "doStepPreEvents", - "private": false, "sentence": "", "events": [ { @@ -5802,35 +6668,27 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "disabled": false, - "folded": false, "name": "Slider logic", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::IsEnabled" }, "parameters": [ "Object", "Behavior", "" - ], - "subInstructions": [] + ] } ], "actions": [], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -5844,14 +6702,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyMouseX" }, "parameters": [ @@ -5859,12 +6714,10 @@ "Behavior", "=", "Object.ToDrawingX(MouseX(Object.Layer(), 0), MouseY(Object.Layer(), 0))" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyMouseY" }, "parameters": [ @@ -5872,15 +6725,11 @@ "Behavior", "=", "Object.ToDrawingY(MouseX(Object.Layer(), 0), MouseY(Object.Layer(), 0))" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -5894,26 +6743,21 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyIsBeingDragged" }, "parameters": [ "Object", "Behavior" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyThumbOffset" }, "parameters": [ @@ -5921,26 +6765,21 @@ "Behavior", "=", "Object.Behavior::PropertyMouseX()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } ], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -5954,41 +6793,32 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "MouseButtonReleased" }, "parameters": [ "", "Left" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyIsBeingDragged" }, "parameters": [ "Object", "Behavior", "no" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -6002,14 +6832,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -6017,15 +6844,11 @@ "Behavior", "Object.Behavior::PropertyValueMin() + (Object.Behavior::PropertyValueMax() - Object.Behavior::PropertyValueMin()) * Object.Behavior::PropertyThumbOffset() / Object.Behavior::PropertyTrackLength()", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -6039,14 +6862,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyTargetHaloRadius" }, "parameters": [ @@ -6054,17 +6874,13 @@ "Behavior", "=", "1.25 * Object.Behavior::PropertyHaloRadius()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -6078,8 +6894,6 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { @@ -6090,15 +6904,12 @@ "parameters": [ "Object", "Behavior" - ], - "subInstructions": [] + ] } ], "actions": [], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -6112,119 +6923,96 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "SourisBouton" }, "parameters": [ "", "Left" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "BuiltinCommonInstructions::Once" }, - "parameters": [], - "subInstructions": [] + "parameters": [] } ], "actions": [], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "Egal" }, "parameters": [ "Object.Behavior::PropertyMouseX()", ">=", "-Object.Behavior::PropertyHaloRadius()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Egal" }, "parameters": [ "Object.Behavior::PropertyMouseX()", "<=", "Object.Behavior::PropertyTrackLength() + Object.Behavior::PropertyHaloRadius()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Egal" }, "parameters": [ "Object.Behavior::PropertyMouseY()", ">=", "-Object.Behavior::PropertyHaloRadius()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Egal" }, "parameters": [ "Object.Behavior::PropertyMouseY()", "<=", "Object.Behavior::PropertyHaloRadius()" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyIsBeingDragged" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -6238,29 +7026,22 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyIsHovered" }, "parameters": [ "Object", "Behavior", "no" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -6274,8 +7055,6 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { @@ -6286,74 +7065,62 @@ "parameters": [ "", "Left" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Egal" }, "parameters": [ "Object.Behavior::PropertyMouseX()", ">=", "Object.Behavior::PropertyThumbOffset() - Object.Behavior::PropertyHaloRadius()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Egal" }, "parameters": [ "Object.Behavior::PropertyMouseX()", "<=", "Object.Behavior::PropertyThumbOffset() + Object.Behavior::PropertyHaloRadius()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Egal" }, "parameters": [ "Object.Behavior::PropertyMouseY()", ">=", "- Object.Behavior::PropertyHaloRadius()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Egal" }, "parameters": [ "Object.Behavior::PropertyMouseY()", "<=", "Object.Behavior::PropertyHaloRadius()" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyIsHovered" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyTargetHaloRadius" }, "parameters": [ @@ -6361,15 +7128,11 @@ "Behavior", "=", "Object.Behavior::PropertyHaloRadius()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -6383,8 +7146,6 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { @@ -6395,14 +7156,12 @@ "parameters": [ "Object", "Behavior" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyTargetHaloRadius" }, "parameters": [ @@ -6410,24 +7169,19 @@ "Behavior", "=", "min(Object.Behavior::PropertyThumbHeight(), Object.Behavior::PropertyThumbWidth()) / 2" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ] } ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyCurrentHaloRadius" }, "parameters": [ @@ -6435,15 +7189,12 @@ "Behavior", "!=", "Object.Behavior::PropertyTargetHaloRadius()" - ], - "subInstructions": [] + ] } ], "actions": [], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -6457,27 +7208,22 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "Egal" }, "parameters": [ "abs(Object.Behavior::PropertyCurrentHaloRadius() - Object.Behavior::PropertyTargetHaloRadius())", "<", "1" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyCurrentHaloRadius" }, "parameters": [ @@ -6485,32 +7231,25 @@ "Behavior", "=", "Object.Behavior::PropertyTargetHaloRadius()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyCurrentHaloRadius" }, "parameters": [ @@ -6518,14 +7257,12 @@ "Behavior", "!=", "Object.Behavior::PropertyTargetHaloRadius()" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyCurrentHaloRadius" }, "parameters": [ @@ -6533,23 +7270,19 @@ "Behavior", "=", "lerp(Object.Behavior::PropertyCurrentHaloRadius(), Object.Behavior::PropertyTargetHaloRadius(), Object.Behavior::PropertyHaloGrowSpeed())" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ] } @@ -6559,22 +7292,14 @@ ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" } @@ -6582,12 +7307,9 @@ "objectGroups": [] }, { - "description": "", "fullName": "", "functionType": "Action", - "group": "", "name": "doStepPostEvents", - "private": false, "sentence": "", "events": [ { @@ -6595,72 +7317,58 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "disabled": false, - "folded": false, "name": "Slider drawing", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyNeedRedraw" }, "parameters": [ "Object", "Behavior" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "Visible" }, "parameters": [ "Object" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "LayerVisible" }, "parameters": [ "", "Object.Layer()" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "no" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "PrimitiveDrawing::Drawer::ClearShapes" }, "parameters": [ "Object" - ], - "subInstructions": [] + ] } ], "events": [ @@ -6669,15 +7377,11 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "disabled": false, - "folded": false, "name": "Inactive track", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -6691,13 +7395,10 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyInactiveTrackColor" }, "parameters": [ @@ -6705,33 +7406,26 @@ "Behavior", "=", "\"\"" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::FillColor" }, "parameters": [ "Object", "Object.Behavior::PropertyThumbColor()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyInactiveTrackColor" }, "parameters": [ @@ -6739,61 +7433,48 @@ "Behavior", "!=", "\"\"" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::FillColor" }, "parameters": [ "Object", "Object.Behavior::PropertyInactiveTrackColor()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::FillOpacity" }, "parameters": [ "Object", "=", "Object.Behavior::PropertyInactiveTrackOpacity()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "PrimitiveDrawing::OutlineOpacity" }, "parameters": [ "Object", "=", "0" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -6807,14 +7488,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::Rectangle" }, "parameters": [ @@ -6823,15 +7501,11 @@ "-Object.Behavior::PropertyTrackThickness() / 2", "Object.Behavior::PropertyTrackLength()", "Object.Behavior::PropertyTrackThickness() / 2" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -6845,26 +7519,21 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyRoundedTrack" }, "parameters": [ "Object", "Behavior" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::Arc" }, "parameters": [ @@ -6876,11 +7545,9 @@ "90", "", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [] @@ -6890,15 +7557,11 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "disabled": false, - "folded": false, "name": "Active track", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -6912,13 +7575,10 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyActiveTrackColor" }, "parameters": [ @@ -6926,33 +7586,26 @@ "Behavior", "=", "\"\"" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::FillColor" }, "parameters": [ "Object", "Object.Behavior::PropertyThumbColor()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyActiveTrackColor" }, "parameters": [ @@ -6960,49 +7613,38 @@ "Behavior", "!=", "\"\"" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::FillColor" }, "parameters": [ "Object", "Object.Behavior::PropertyActiveTrackColor()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::FillOpacity" }, "parameters": [ "Object", "=", "Object.Behavior::PropertyActiveTrackOpacity()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -7016,14 +7658,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::Rectangle" }, "parameters": [ @@ -7032,15 +7671,11 @@ "-(Object.Behavior::PropertyTrackThickness() / 2 + 1)", "Object.Behavior::PropertyThumbOffset()", "Object.Behavior::PropertyTrackThickness() / 2 + 1" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -7054,26 +7689,21 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyRoundedTrack" }, "parameters": [ "Object", "Behavior" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::Arc" }, "parameters": [ @@ -7085,11 +7715,9 @@ "270", "", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [] @@ -7099,20 +7727,15 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "disabled": false, - "folded": false, "name": "Halo", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyCurrentHaloRadius" }, "parameters": [ @@ -7120,15 +7743,12 @@ "Behavior", ">", "min(Object.Behavior::PropertyThumbHeight(), Object.Behavior::PropertyThumbWidth()) / 2" - ], - "subInstructions": [] + ] } ], "actions": [], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -7142,40 +7762,31 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::FillColor" }, "parameters": [ "Object", "Object.Behavior::PropertyThumbColor()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "PrimitiveDrawing::OutlineOpacity" }, "parameters": [ "Object", "=", "0" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -7189,8 +7800,6 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { @@ -7201,26 +7810,22 @@ "parameters": [ "Object", "Behavior" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::FillOpacity" }, "parameters": [ "Object", "=", "Object.Behavior::PropertyHaloOpacityHover()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "PrimitiveDrawing::Circle" }, "parameters": [ @@ -7228,15 +7833,11 @@ "Object.Behavior::PropertyThumbOffset()", "0", "Object.Behavior::PropertyCurrentHaloRadius()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -7250,38 +7851,31 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyIsBeingDragged" }, "parameters": [ "Object", "Behavior" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::FillOpacity" }, "parameters": [ "Object", "=", "Object.Behavior::PropertyHaloOpacityClick()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "PrimitiveDrawing::Circle" }, "parameters": [ @@ -7289,11 +7883,9 @@ "Object.Behavior::PropertyThumbOffset()", "0", "Object.Behavior::PropertyCurrentHaloRadius()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ] } @@ -7305,15 +7897,11 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "disabled": false, - "folded": false, "name": "Thumb", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -7327,40 +7915,31 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::FillColor" }, "parameters": [ "Object", "Object.Behavior::PropertyThumbColor()" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "PrimitiveDrawing::FillOpacity" }, "parameters": [ "Object", "=", "Object.Behavior::PropertyThumbOpacity()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -7374,13 +7953,10 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyThumbShape" }, "parameters": [ @@ -7388,14 +7964,12 @@ "Behavior", "=", "\"circle\"" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::Circle" }, "parameters": [ @@ -7403,15 +7977,11 @@ "Object.Behavior::PropertyThumbOffset()", "0", "ceil(max(Object.Behavior::PropertyThumbWidth(),Object.Behavior::PropertyThumbHeight())/2)" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -7425,13 +7995,10 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyThumbShape" }, "parameters": [ @@ -7439,14 +8006,12 @@ "Behavior", "=", "\"rectangle\"" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::Rectangle" }, "parameters": [ @@ -7455,11 +8020,9 @@ "-Object.Behavior::PropertyThumbHeight() / 2", "Object.Behavior::PropertyThumbOffset() + (Object.Behavior::PropertyThumbWidth() / 2)", "Object.Behavior::PropertyThumbHeight() / 2" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [] @@ -7472,22 +8035,14 @@ ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" } @@ -7500,59 +8055,43 @@ "functionType": "Condition", "group": "Slider", "name": "IsBeingDragged", - "private": false, "sentence": "_PARAM0_ is being dragged", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyIsBeingDragged" }, "parameters": [ "Object", "Behavior" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "SetReturnBoolean" }, "parameters": [ "True" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" } @@ -7565,59 +8104,43 @@ "functionType": "Condition", "group": "Slider", "name": "IsEnabled", - "private": false, "sentence": "Interactions of _PARAM0_ are enabled", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyEnabled" }, "parameters": [ "Object", "Behavior" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "SetReturnBoolean" }, "parameters": [ "True" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" } @@ -7630,12 +8153,9 @@ "functionType": "Action", "group": "Slider", "name": "SetEnabled", - "private": false, "sentence": "Enable interactions of _PARAM0_: _PARAM2_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { @@ -7645,28 +8165,23 @@ }, "parameters": [ "\"Enable\"" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyEnabled" }, "parameters": [ "Object", "Behavior", "no" - ], - "subInstructions": [] + ] } ], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -7680,29 +8195,22 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyIsBeingDragged" }, "parameters": [ "Object", "Behavior", "no" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -7716,14 +8224,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyTargetHaloRadius" }, "parameters": [ @@ -7731,97 +8236,70 @@ "Behavior", "=", "min(Object.Behavior::PropertyThumbHeight(), Object.Behavior::PropertyThumbWidth()) / 2" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "GetArgumentAsBoolean" }, "parameters": [ "\"Enable\"" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyEnabled" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Enable", - "longDescription": "", "name": "Enable", - "optional": false, - "supplementaryInformation": "", "type": "yesorno" } ], @@ -7833,47 +8311,36 @@ "functionType": "Expression", "group": "Slider", "name": "Value", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "SetReturnNumber" }, "parameters": [ "Object.Behavior::PropertyValue()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" } @@ -7886,17 +8353,13 @@ "functionType": "Action", "group": "Slider", "name": "SetValue", - "private": false, "sentence": "Change the value of _PARAM0_: _PARAM2_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyTickSpacing" }, "parameters": [ @@ -7904,14 +8367,12 @@ "Behavior", "<=", "0" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyValue" }, "parameters": [ @@ -7919,20 +8380,15 @@ "Behavior", "=", "GetArgumentAsNumber(\"Value\")" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyTickSpacing" }, "parameters": [ @@ -7940,14 +8396,12 @@ "Behavior", ">", "0" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyValue" }, "parameters": [ @@ -7955,20 +8409,15 @@ "Behavior", "=", "round(GetArgumentAsNumber(\"Value\") / Object.Behavior::PropertyTickSpacing()) * Object.Behavior::PropertyTickSpacing()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyValue" }, "parameters": [ @@ -7976,14 +8425,12 @@ "Behavior", "<", "Object.Behavior::PropertyValueMin()" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyValue" }, "parameters": [ @@ -7991,20 +8438,15 @@ "Behavior", "=", "Object.Behavior::PropertyValueMin()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyValue" }, "parameters": [ @@ -8012,14 +8454,12 @@ "Behavior", ">", "Object.Behavior::PropertyValueMax()" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyValue" }, "parameters": [ @@ -8027,15 +8467,11 @@ "Behavior", "=", "Object.Behavior::PropertyValueMax()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -8049,14 +8485,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyThumbOffset" }, "parameters": [ @@ -8064,54 +8497,37 @@ "Behavior", "=", "Object.Behavior::PropertyTrackLength() * (Object.Behavior::PropertyValue() - Object.Behavior::PropertyValueMin()) / (Object.Behavior::PropertyValueMax() - Object.Behavior::PropertyValueMin())" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Slider value", - "longDescription": "", "name": "Value", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -8123,47 +8539,36 @@ "functionType": "Expression", "group": "Slider value configuration", "name": "ValueMin", - "private": false, "sentence": "Change the maximum value of _PARAM0_: _PARAM2_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "SetReturnNumber" }, "parameters": [ "Object.Behavior::PropertyValueMin()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" } @@ -8176,18 +8581,14 @@ "functionType": "Action", "group": "Slider value configuration", "name": "SetValueMin", - "private": false, "sentence": "Change the maximum value of _PARAM0_: _PARAM2_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyValueMin" }, "parameters": [ @@ -8195,12 +8596,10 @@ "Behavior", "=", "GetArgumentAsNumber(\"ValueMin\")" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -8208,42 +8607,27 @@ "Behavior", "Object.Behavior::Value()", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Minimum value", - "longDescription": "", "name": "ValueMin", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -8255,47 +8639,36 @@ "functionType": "Expression", "group": "Slider value configuration", "name": "ValueMax", - "private": false, "sentence": "Change the maximum value of _PARAM0_: _PARAM2_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "SetReturnNumber" }, "parameters": [ "Object.Behavior::PropertyValueMax()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" } @@ -8308,18 +8681,14 @@ "functionType": "Action", "group": "Slider value configuration", "name": "SetValueMax", - "private": false, "sentence": "Change the minimum value of _PARAM0_: _PARAM2_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyValueMax" }, "parameters": [ @@ -8327,12 +8696,10 @@ "Behavior", "=", "GetArgumentAsNumber(\"ValueMax\")" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -8340,42 +8707,27 @@ "Behavior", "Object.Behavior::Value()", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Maximum value", - "longDescription": "", "name": "ValueMax", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -8387,58 +8739,42 @@ "functionType": "Expression", "group": "Slider value configuration", "name": "TickSpacing", - "private": false, "sentence": "Change the tick spacing of _PARAM0_: _PARAM2_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "SetReturnNumber" }, "parameters": [ "Object.Behavior::PropertyTickSpacing()" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Tick spacing", - "longDescription": "", "name": "TickSpacing", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -8450,18 +8786,14 @@ "functionType": "Action", "group": "Slider value configuration", "name": "SetTickSpacing", - "private": false, "sentence": "Change the tick spacing of _PARAM0_: _PARAM2_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyTickSpacing" }, "parameters": [ @@ -8469,12 +8801,10 @@ "Behavior", "=", "GetArgumentAsNumber(\"TickSpacing\")" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -8482,42 +8812,27 @@ "Behavior", "Object.Behavior::Value()", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Tick spacing", - "longDescription": "", "name": "TickSpacing", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -8529,18 +8844,14 @@ "functionType": "Action", "group": "Slider track configuration", "name": "SetTrackLength", - "private": false, "sentence": "Change track length of _PARAM0_ to _PARAM2_px", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyTrackLength" }, "parameters": [ @@ -8548,39 +8859,31 @@ "Behavior", "=", "GetArgumentAsNumber(\"Value\")" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::UpdateHitbox" }, "parameters": [ "Object", "Behavior", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -8594,14 +8897,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetValue" }, "parameters": [ @@ -8609,42 +8909,27 @@ "Behavior", "Object.Behavior::PropertyValue()", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Track width", - "longDescription": "", "name": "Value", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -8656,18 +8941,14 @@ "functionType": "Action", "group": "Slider track configuration", "name": "SetTrackThickness", - "private": false, "sentence": "Change track thickness of _PARAM0_ to _PARAM2_px", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyTrackThickness" }, "parameters": [ @@ -8675,27 +8956,21 @@ "Behavior", "=", "GetArgumentAsNumber(\"Value\")" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -8709,13 +8984,10 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyThumbWidth" }, "parameters": [ @@ -8723,14 +8995,12 @@ "Behavior", "<", "Object.Behavior::PropertyTrackThickness() + 2" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetThumbWidth" }, "parameters": [ @@ -8738,20 +9008,15 @@ "Behavior", "Object.Behavior::PropertyTrackThickness() + 2", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyThumbHeight" }, "parameters": [ @@ -8759,14 +9024,12 @@ "Behavior", "<", "Object.Behavior::PropertyTrackThickness() + 2" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetThumbHeight" }, "parameters": [ @@ -8774,42 +9037,27 @@ "Behavior", "Object.Behavior::PropertyTrackThickness() + 2", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Track thickness", - "longDescription": "", "name": "Value", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -8821,12 +9069,9 @@ "functionType": "Action", "group": "Slider thumb configuration", "name": "SetThumbWidth", - "private": false, "sentence": "Change thumb width of _PARAM0_ to _PARAM2_px", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -8840,14 +9085,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyThumbWidth" }, "parameters": [ @@ -8855,75 +9097,53 @@ "Behavior", "=", "max(GetArgumentAsNumber(\"Value\"), Object.Behavior::PropertyTrackThickness() + 2)" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::UpdateHitbox" }, "parameters": [ "Object", "Behavior", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Thumb width", - "longDescription": "", "name": "Value", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -8935,12 +9155,9 @@ "functionType": "Action", "group": "Slider thumb configuration", "name": "SetThumbHeight", - "private": false, "sentence": "Change thumb height of _PARAM0_ to _PARAM2_px", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -8954,14 +9171,11 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyThumbHeight" }, "parameters": [ @@ -8969,75 +9183,53 @@ "Behavior", "=", "max(GetArgumentAsNumber(\"Value\"), Object.Behavior::PropertyTrackThickness() + 2)" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::UpdateHitbox" }, "parameters": [ "Object", "Behavior", "" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Thumb height", - "longDescription": "", "name": "Value", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -9049,18 +9241,14 @@ "functionType": "Action", "group": "Slider thumb configuration", "name": "SetHaloRadius", - "private": false, "sentence": "Change halo radius of _PARAM0_ to _PARAM2_px", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyHaloRadius" }, "parameters": [ @@ -9068,54 +9256,37 @@ "Behavior", "=", "GetArgumentAsNumber(\"Value\")" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Halo radius", - "longDescription": "", "name": "Value", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -9127,18 +9298,14 @@ "functionType": "Action", "group": "Slider thumb configuration", "name": "SetThumbShape", - "private": false, "sentence": "Change shape of _PARAM0_ to _PARAM2_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyThumbShape" }, "parameters": [ @@ -9146,27 +9313,21 @@ "Behavior", "=", "GetArgumentAsString(\"Shape\")" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -9180,13 +9341,10 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyThumbShape" }, "parameters": [ @@ -9194,12 +9352,10 @@ "Behavior", "=", "\"rectangle\"" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::PropertyThumbWidth" }, "parameters": [ @@ -9207,14 +9363,12 @@ "Behavior", "<", "Object.Behavior::PropertyTrackThickness()" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetThumbWidth" }, "parameters": [ @@ -9222,41 +9376,27 @@ "Behavior", "Object.Behavior::PropertyTrackThickness()", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "New thumb shape", - "longDescription": "", "name": "Shape", - "optional": false, "supplementaryInformation": "[\"circle\",\"rectangle\"]", "type": "stringWithSelector" } @@ -9269,128 +9409,95 @@ "functionType": "Action", "group": "Slider track configuration", "name": "SetRoundedTrack", - "private": false, "sentence": "Draw _PARAM0_ with a rounded track: _PARAM2_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "Egal" }, "parameters": [ "GetArgumentAsNumber(\"Value\")", "=", "0" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyRoundedTrack" }, "parameters": [ "Object", "Behavior", "no" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "Egal" }, "parameters": [ "GetArgumentAsNumber(\"Value\")", "=", "1" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyRoundedTrack" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Rounded track", - "longDescription": "", "name": "Value", - "optional": false, - "supplementaryInformation": "", "type": "yesorno" } ], @@ -9402,18 +9509,14 @@ "functionType": "Action", "group": "Slider thumb configuration", "name": "SetThumbOpacity", - "private": false, "sentence": "Change thumb opacity of _PARAM0_ to _PARAM2_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyThumbOpacity" }, "parameters": [ @@ -9421,54 +9524,37 @@ "Behavior", "=", "GetArgumentAsNumber(\"Value\")" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Thumb opacity", - "longDescription": "", "name": "Value", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -9480,18 +9566,14 @@ "functionType": "Action", "group": "Slider track configuration", "name": "SetInactiveTrackOpacity", - "private": false, "sentence": "Change inactive track opacity of _PARAM0_ to _PARAM2_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyInactiveTrackOpacity" }, "parameters": [ @@ -9499,54 +9581,37 @@ "Behavior", "=", "GetArgumentAsNumber(\"Value\")" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Inactive track opacity", - "longDescription": "", "name": "Value", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -9558,18 +9623,14 @@ "functionType": "Action", "group": "Slider track configuration", "name": "SetActiveTrackOpacity", - "private": false, "sentence": "Change active track opacity of _PARAM0_ to _PARAM2_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyActiveTrackOpacity" }, "parameters": [ @@ -9577,54 +9638,37 @@ "Behavior", "=", "GetArgumentAsNumber(\"Value\")" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Active track opacity", - "longDescription": "", "name": "Value", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -9636,72 +9680,51 @@ "functionType": "Action", "group": "Slider track configuration", "name": "SetActiveTrackColor", - "private": false, "sentence": "Change active track color of _PARAM0_ to _PARAM2_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyActiveTrackColor" }, "parameters": [ "Object", "Behavior", "GetArgumentAsString(\"Color\")" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Active track color", - "longDescription": "", "name": "Color", - "optional": false, - "supplementaryInformation": "", "type": "color" } ], @@ -9713,72 +9736,51 @@ "functionType": "Action", "group": "Slider track configuration", "name": "SetInactiveTrackColor", - "private": false, "sentence": "Change inactive track color of _PARAM0_ to _PARAM2_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyInactiveTrackColor" }, "parameters": [ "Object", "Behavior", "GetArgumentAsString(\"Color\")" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Inactive track color", - "longDescription": "", "name": "Color", - "optional": false, - "supplementaryInformation": "", "type": "color" } ], @@ -9790,72 +9792,51 @@ "functionType": "Action", "group": "Slider thumb configuration", "name": "SetThumbColor", - "private": false, "sentence": "Change thumb color of _PARAM0_ to _PARAM2_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyThumbColor" }, "parameters": [ "Object", "Behavior", "GetArgumentAsString(\"Color\")" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "DraggableSliderControl::DraggableSliderControl::SetPropertyNeedRedraw" }, "parameters": [ "Object", "Behavior", "yes" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Thumb color", - "longDescription": "", "name": "Color", - "optional": false, - "supplementaryInformation": "", "type": "color" } ], @@ -9871,26 +9852,21 @@ "sentence": "Update the hitbox of _PARAM0_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "PrimitiveDrawing::SetRotationCenter" }, "parameters": [ "Object", "Object.Behavior::PropertyTrackLength() / 2", "Object.Behavior::PropertyTrackThickness() / 2" - ], - "subInstructions": [] + ] }, { "type": { - "inverted": false, "value": "PrimitiveDrawing::SetRectangularCollisionMask" }, "parameters": [ @@ -9899,31 +9875,21 @@ "-Object.Behavior::PropertyThumbHeight() / 2", "Object.Behavior::PropertyTrackLength() + Object.Behavior::PropertyThumbWidth() / 2", "Object.Behavior::PropertyThumbHeight() / 2" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PrimitiveDrawing::Drawer", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "DraggableSliderControl::DraggableSliderControl", "type": "behavior" } @@ -10225,14 +10191,15 @@ "hidden": true, "name": "TargetHaloRadius" } - ] + ], + "sharedPropertyDescriptors": [] } - ] + ], + "eventsBasedObjects": [] }, { "author": "Add00, AlanPH, Tristan (Victris Games)", "category": "", - "description": "Expressions to convert color values between various formats (RGB, HSV, HSL, named colors) and get colors between 2 others.", "extensionNamespace": "", "fullName": "Color Conversion", "helpPath": "", @@ -10241,6 +10208,7 @@ "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/invert-colors.svg", "shortDescription": "Expressions to convert color values between various formats (RGB, HSV, HSL, named colors) and get colors between 2 others.", "version": "13.0", + "description": "Expressions to convert color values between various formats (RGB, HSV, HSL, named colors) and get colors between 2 others.", "origin": { "identifier": "ColorConversion", "name": "gdevelop-extension-store" @@ -10265,30 +10233,47 @@ "description": "Converts a hexadecimal string into a RGB string. Example input: \"0459AF\".", "fullName": "Hexadecimal to RGB", "functionType": "StringExpression", - "group": "", "name": "HexToRgb", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "try {\n let n = eventsFunctionContext.getArgument(\"n\");\n\n //input validation\n let v = parseInt(n, 16);\n if (v.toString(16) === n.toUpperCase()) throw 'input is not hexadecimal'; \n\n let shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n n = n.replace(shorthandRegex, function (m, r, g, b) {\n return r + r + g + g + b + b;\n });\n let result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(n);\n\n let r = parseInt(result[1], 16),\n g = parseInt(result[2], 16),\n b = parseInt(result[3], 16);\n\n eventsFunctionContext.returnValue = r + ';' + g + ';' + b;\n} catch(e) {\n console.error(\"Unable to convert a color: \", e);\n eventsFunctionContext.returnValue = \"0;0;0\";\n}", + "inlineCode": [ + "try {", + " let n = eventsFunctionContext.getArgument(\"n\");", + "", + " //input validation", + " let v = parseInt(n, 16);", + " if (v.toString(16) === n.toUpperCase()) throw 'input is not hexadecimal'; ", + "", + " let shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;", + " n = n.replace(shorthandRegex, function (m, r, g, b) {", + " return r + r + g + g + b + b;", + " });", + " let result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(n);", + "", + " let r = parseInt(result[1], 16),", + " g = parseInt(result[2], 16),", + " b = parseInt(result[3], 16);", + "", + " eventsFunctionContext.returnValue = r + ';' + g + ';' + b;", + "} catch(e) {", + " console.error(\"Unable to convert a color: \", e);", + " eventsFunctionContext.returnValue = \"0;0;0\";", + "}" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ], + "expressionType": { + "type": "string" + }, "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Hex value", - "longDescription": "", "name": "n", - "optional": false, - "supplementaryInformation": "", "type": "color" } ], @@ -10298,50 +10283,58 @@ "description": "Apply a weighted mean between 2 RGB colors.", "fullName": "RGB mean", "functionType": "StringExpression", - "group": "", "name": "RgbMean", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "try {\n // split do allocations, but the code a lot simpler this way.\n const components1 = eventsFunctionContext.getArgument(\"Color1\").split(\";\");\n const r1 = gdjs.evtTools.common.clamp(parseFloat(components1[0]), 0, 255);\n const g1 = gdjs.evtTools.common.clamp(parseFloat(components1[1]), 0, 255);\n const b1 = gdjs.evtTools.common.clamp(parseFloat(components1[2]), 0, 255);\n\n const components2 = eventsFunctionContext.getArgument(\"Color2\").split(\";\");\n const r2 = gdjs.evtTools.common.clamp(parseFloat(components2[0]), 0, 255);\n const g2 = gdjs.evtTools.common.clamp(parseFloat(components2[1]), 0, 255);\n const b2 = gdjs.evtTools.common.clamp(parseFloat(components2[2]), 0, 255);\n\n const ratio = eventsFunctionContext.getArgument(\"Ratio\");\n const r = gdjs.evtTools.common.clamp(Math.round((1 - ratio) * r1 + ratio * r2), 0, 255);\n const g = gdjs.evtTools.common.clamp(Math.round((1 - ratio) * g1 + ratio * g2), 0, 255);\n const b = gdjs.evtTools.common.clamp(Math.round((1 - ratio) * b1 + ratio * b2), 0, 255);\n\n eventsFunctionContext.returnValue = r + \";\" + g + \";\" + b;\n} catch (e) {\n console.error(\"Unable to convert a color: \", e);\n eventsFunctionContext.returnValue = \"0;0;0\";\n}", + "inlineCode": [ + "try {", + " // split do allocations, but the code a lot simpler this way.", + " const components1 = eventsFunctionContext.getArgument(\"Color1\").split(\";\");", + " const r1 = gdjs.evtTools.common.clamp(parseFloat(components1[0]), 0, 255);", + " const g1 = gdjs.evtTools.common.clamp(parseFloat(components1[1]), 0, 255);", + " const b1 = gdjs.evtTools.common.clamp(parseFloat(components1[2]), 0, 255);", + "", + " const components2 = eventsFunctionContext.getArgument(\"Color2\").split(\";\");", + " const r2 = gdjs.evtTools.common.clamp(parseFloat(components2[0]), 0, 255);", + " const g2 = gdjs.evtTools.common.clamp(parseFloat(components2[1]), 0, 255);", + " const b2 = gdjs.evtTools.common.clamp(parseFloat(components2[2]), 0, 255);", + "", + " const ratio = eventsFunctionContext.getArgument(\"Ratio\");", + " const r = gdjs.evtTools.common.clamp(Math.round((1 - ratio) * r1 + ratio * r2), 0, 255);", + " const g = gdjs.evtTools.common.clamp(Math.round((1 - ratio) * g1 + ratio * g2), 0, 255);", + " const b = gdjs.evtTools.common.clamp(Math.round((1 - ratio) * b1 + ratio * b2), 0, 255);", + "", + " eventsFunctionContext.returnValue = r + \";\" + g + \";\" + b;", + "} catch (e) {", + " console.error(\"Unable to convert a color: \", e);", + " eventsFunctionContext.returnValue = \"0;0;0\";", + "}" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ], + "expressionType": { + "type": "string" + }, "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "First RGB color", - "longDescription": "", "name": "Color1", - "optional": false, - "supplementaryInformation": "", "type": "color" }, { - "codeOnly": false, - "defaultValue": "", "description": "Second RGB color", - "longDescription": "", "name": "Color2", - "optional": false, - "supplementaryInformation": "", "type": "color" }, { - "codeOnly": false, - "defaultValue": "", "description": "Ratio", "longDescription": "0 gives the first color, 1 gives the second color", "name": "Ratio", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -10351,30 +10344,42 @@ "description": "Converts a RGB string into a hexadecimal string. Example input: \"0;128;255\".", "fullName": "RGB to hexadecimal", "functionType": "StringExpression", - "group": "", "name": "RgbToHex", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "try {\n const n = eventsFunctionContext.getArgument(\"n\");\n const col = n.split(\";\");\n \n let r = parseFloat(col[0]),\n g = parseFloat(col[1]),\n b = parseFloat(col[2]);\n\n r = gdjs.evtTools.common.clamp(r, 0, 255);\n g = gdjs.evtTools.common.clamp(g, 0, 255);\n b = gdjs.evtTools.common.clamp(b, 0, 255);\n\n eventsFunctionContext.returnValue = \"#\" + gdjs.rgbToHex(r, g, b).toUpperCase();\n} catch (e) {\n console.error(\"Unable to convert a color: \", e);\n eventsFunctionContext.returnValue = \"#000000\";\n}", + "inlineCode": [ + "try {", + " const n = eventsFunctionContext.getArgument(\"n\");", + " const col = n.split(\";\");", + " ", + " let r = parseFloat(col[0]),", + " g = parseFloat(col[1]),", + " b = parseFloat(col[2]);", + "", + " r = gdjs.evtTools.common.clamp(r, 0, 255);", + " g = gdjs.evtTools.common.clamp(g, 0, 255);", + " b = gdjs.evtTools.common.clamp(b, 0, 255);", + "", + " eventsFunctionContext.returnValue = \"#\" + gdjs.rgbToHex(r, g, b).toUpperCase();", + "} catch (e) {", + " console.error(\"Unable to convert a color: \", e);", + " eventsFunctionContext.returnValue = \"#000000\";", + "}" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ], + "expressionType": { + "type": "string" + }, "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "RGB value", - "longDescription": "", "name": "n", - "optional": false, - "supplementaryInformation": "", "type": "color" } ], @@ -10384,30 +10389,45 @@ "description": "Return the hue for a RGB string. Example input: \"0;128;255\"\".", "fullName": "Hue", "functionType": "Expression", - "group": "", "name": "Hue", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "const n = eventsFunctionContext.getArgument(\"RgbColor\");\nconst col = n.split(\";\");\n\nlet r = parseFloat(col[0]),\n g = parseFloat(col[1]),\n b = parseFloat(col[2]);\n\n r = gdjs.evtTools.common.clamp(r, 0, 255);\n g = gdjs.evtTools.common.clamp(g, 0, 255);\n b = gdjs.evtTools.common.clamp(b, 0, 255);\n\nr /= 255;\ng /= 255;\nb /= 255;\n\nlet v = Math.max(r, g, b), c = v - Math.min(r, g, b), f = (1 - Math.abs(v + v - c - 1));\nlet h = c && ((v === r) ? (g - b) / c: ((v === g) ? 2 + (b - r) / c: 4 + (r - g) / c)); \n\neventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(60 * (h < 0 ? h + 6: h), 0, 360);\n", + "inlineCode": [ + "const n = eventsFunctionContext.getArgument(\"RgbColor\");", + "const col = n.split(\";\");", + "", + "let r = parseFloat(col[0]),", + " g = parseFloat(col[1]),", + " b = parseFloat(col[2]);", + "", + " r = gdjs.evtTools.common.clamp(r, 0, 255);", + " g = gdjs.evtTools.common.clamp(g, 0, 255);", + " b = gdjs.evtTools.common.clamp(b, 0, 255);", + "", + "r /= 255;", + "g /= 255;", + "b /= 255;", + "", + "let v = Math.max(r, g, b), c = v - Math.min(r, g, b), f = (1 - Math.abs(v + v - c - 1));", + "let h = c && ((v === r) ? (g - b) / c: ((v === g) ? 2 + (b - r) / c: 4 + (r - g) / c)); ", + "", + "eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(60 * (h < 0 ? h + 6: h), 0, 360);", + "" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "RGB value", - "longDescription": "", "name": "RgbColor", - "optional": false, - "supplementaryInformation": "", "type": "color" } ], @@ -10417,30 +10437,45 @@ "description": "Return the saturation for a RGB string. Example input: \"0;128;255\"\".", "fullName": "Saturation", "functionType": "Expression", - "group": "", "name": "Saturation", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "const n = eventsFunctionContext.getArgument(\"RgbColor\");\nconst col = n.split(\";\");\n\nlet r = parseFloat(col[0]),\n g = parseFloat(col[1]),\n b = parseFloat(col[2]);\n\n r = gdjs.evtTools.common.clamp(r, 0, 255);\n g = gdjs.evtTools.common.clamp(g, 0, 255);\n b = gdjs.evtTools.common.clamp(b, 0, 255);\n\nr /= 255;\ng /= 255;\nb /= 255;\n\nlet v = Math.max(r, g, b), c = v - Math.min(r, g, b), f = (1 - Math.abs(v + v - c - 1));\nlet h = c && ((v === r) ? (g - b) / c: ((v === g) ? 2 + (b - r) / c: 4 + (r - g) / c)); \n\neventsFunctionContext.returnValue = gdjs.evtTools.common.clamp((f ? c / f: 0) * 100, 0, 100);\n", + "inlineCode": [ + "const n = eventsFunctionContext.getArgument(\"RgbColor\");", + "const col = n.split(\";\");", + "", + "let r = parseFloat(col[0]),", + " g = parseFloat(col[1]),", + " b = parseFloat(col[2]);", + "", + " r = gdjs.evtTools.common.clamp(r, 0, 255);", + " g = gdjs.evtTools.common.clamp(g, 0, 255);", + " b = gdjs.evtTools.common.clamp(b, 0, 255);", + "", + "r /= 255;", + "g /= 255;", + "b /= 255;", + "", + "let v = Math.max(r, g, b), c = v - Math.min(r, g, b), f = (1 - Math.abs(v + v - c - 1));", + "let h = c && ((v === r) ? (g - b) / c: ((v === g) ? 2 + (b - r) / c: 4 + (r - g) / c)); ", + "", + "eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp((f ? c / f: 0) * 100, 0, 100);", + "" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "RGB value", - "longDescription": "", "name": "RgbColor", - "optional": false, - "supplementaryInformation": "", "type": "color" } ], @@ -10450,30 +10485,45 @@ "description": "Return the lightness for a RGB string. Example input: \"0;128;255\"\".", "fullName": "Lightness", "functionType": "Expression", - "group": "", "name": "Lightness", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "const n = eventsFunctionContext.getArgument(\"RgbColor\");\nconst col = n.split(\";\");\n\nlet r = parseFloat(col[0]),\n g = parseFloat(col[1]),\n b = parseFloat(col[2]);\n\n r = gdjs.evtTools.common.clamp(r, 0, 255);\n g = gdjs.evtTools.common.clamp(g, 0, 255);\n b = gdjs.evtTools.common.clamp(b, 0, 255);\n\nr /= 255;\ng /= 255;\nb /= 255;\n\nlet v = Math.max(r, g, b), c = v - Math.min(r, g, b), f = (1 - Math.abs(v + v - c - 1));\nlet h = c && ((v === r) ? (g - b) / c: ((v === g) ? 2 + (b - r) / c: 4 + (r - g) / c)); \n\neventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(((v + v - c) / 2) * 100, 0, 100);\n", + "inlineCode": [ + "const n = eventsFunctionContext.getArgument(\"RgbColor\");", + "const col = n.split(\";\");", + "", + "let r = parseFloat(col[0]),", + " g = parseFloat(col[1]),", + " b = parseFloat(col[2]);", + "", + " r = gdjs.evtTools.common.clamp(r, 0, 255);", + " g = gdjs.evtTools.common.clamp(g, 0, 255);", + " b = gdjs.evtTools.common.clamp(b, 0, 255);", + "", + "r /= 255;", + "g /= 255;", + "b /= 255;", + "", + "let v = Math.max(r, g, b), c = v - Math.min(r, g, b), f = (1 - Math.abs(v + v - c - 1));", + "let h = c && ((v === r) ? (g - b) / c: ((v === g) ? 2 + (b - r) / c: 4 + (r - g) / c)); ", + "", + "eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(((v + v - c) / 2) * 100, 0, 100);", + "" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "RGB value", - "longDescription": "", "name": "RgbColor", - "optional": false, - "supplementaryInformation": "", "type": "color" } ], @@ -10483,30 +10533,45 @@ "description": "Converts a RGB string into a HSL string. Example input: \"0;128;255\"\".", "fullName": "RGB to HSL", "functionType": "StringExpression", - "group": "", "name": "RgbToHsl", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "const n = eventsFunctionContext.getArgument(\"n\");\nconst col = n.split(\";\");\n\nlet r = parseFloat(col[0]),\n g = parseFloat(col[1]),\n b = parseFloat(col[2]);\n\n r = gdjs.evtTools.common.clamp(r, 0, 255);\n g = gdjs.evtTools.common.clamp(g, 0, 255);\n b = gdjs.evtTools.common.clamp(b, 0, 255);\n\nr /= 255;\ng /= 255;\nb /= 255;\n\nlet v = Math.max(r, g, b), c = v - Math.min(r, g, b), f = (1 - Math.abs(v + v - c - 1));\nlet h = c && ((v === r) ? (g - b) / c: ((v === g) ? 2 + (b - r) / c: 4 + (r - g) / c)); \n\neventsFunctionContext.returnValue = Math.round(60 * (h < 0 ? h + 6: h)) + ';' + Math.round((f ? c / f: 0) * 100) + ';' + Math.round(((v + v - c) / 2) * 100);\n", + "inlineCode": [ + "const n = eventsFunctionContext.getArgument(\"n\");", + "const col = n.split(\";\");", + "", + "let r = parseFloat(col[0]),", + " g = parseFloat(col[1]),", + " b = parseFloat(col[2]);", + "", + " r = gdjs.evtTools.common.clamp(r, 0, 255);", + " g = gdjs.evtTools.common.clamp(g, 0, 255);", + " b = gdjs.evtTools.common.clamp(b, 0, 255);", + "", + "r /= 255;", + "g /= 255;", + "b /= 255;", + "", + "let v = Math.max(r, g, b), c = v - Math.min(r, g, b), f = (1 - Math.abs(v + v - c - 1));", + "let h = c && ((v === r) ? (g - b) / c: ((v === g) ? 2 + (b - r) / c: 4 + (r - g) / c)); ", + "", + "eventsFunctionContext.returnValue = Math.round(60 * (h < 0 ? h + 6: h)) + ';' + Math.round((f ? c / f: 0) * 100) + ';' + Math.round(((v + v - c) / 2) * 100);", + "" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ], + "expressionType": { + "type": "string" + }, "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "RGB value", - "longDescription": "", "name": "n", - "optional": false, - "supplementaryInformation": "", "type": "color" } ], @@ -10516,50 +10581,59 @@ "description": "Converts HSV color values into a RGB string. Valid input ranges: H(0 to 360), S(0 to 100), V(0 to 100).", "fullName": "HSV to RGB", "functionType": "StringExpression", - "group": "", "name": "HsvToRgb", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "try {\n\n let h = parseFloat(eventsFunctionContext.getArgument(\"h\")),\n s = parseFloat(eventsFunctionContext.getArgument(\"s\")),\n v = parseFloat(eventsFunctionContext.getArgument(\"v\"));\n \n s = gdjs.evtTools.common.clamp(s, 0, 100);\n v = gdjs.evtTools.common.clamp(v, 0, 100);\n\n h %= 360;\n if (h < 0) {\n h += 360;\n }\n\n s /= 100;\n v /= 100;\n\n let f = (n , k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n\n eventsFunctionContext.returnValue = Math.round(f(5) * 255) + ';' + Math.round(f(3) * 255) + ';' + Math.round(f(1) * 255);\n} catch(e) {\n console.error(\"Unable to convert a color: \", e);\n eventsFunctionContext.returnValue = \"0;0;0\";\n}", + "inlineCode": [ + "try {", + "", + " let h = parseFloat(eventsFunctionContext.getArgument(\"h\")),", + " s = parseFloat(eventsFunctionContext.getArgument(\"s\")),", + " v = parseFloat(eventsFunctionContext.getArgument(\"v\"));", + " ", + " s = gdjs.evtTools.common.clamp(s, 0, 100);", + " v = gdjs.evtTools.common.clamp(v, 0, 100);", + "", + " h %= 360;", + " if (h < 0) {", + " h += 360;", + " }", + "", + " s /= 100;", + " v /= 100;", + "", + " let f = (n , k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);", + "", + " eventsFunctionContext.returnValue = Math.round(f(5) * 255) + ';' + Math.round(f(3) * 255) + ';' + Math.round(f(1) * 255);", + "} catch(e) {", + " console.error(\"Unable to convert a color: \", e);", + " eventsFunctionContext.returnValue = \"0;0;0\";", + "}" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ], + "expressionType": { + "type": "string" + }, "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Hue 0-360", - "longDescription": "", "name": "h", - "optional": false, - "supplementaryInformation": "", "type": "expression" }, { - "codeOnly": false, - "defaultValue": "", "description": "Saturation 0-100", - "longDescription": "", "name": "s", - "optional": false, - "supplementaryInformation": "", "type": "expression" }, { - "codeOnly": false, - "defaultValue": "", "description": "Value 0-100", - "longDescription": "", "name": "v", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -10569,30 +10643,51 @@ "description": "Converts a RGB string into a HSV string. Example input: \"0;128;255\".", "fullName": "RGB to HSV", "functionType": "StringExpression", - "group": "", "name": "RgbToHsv", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "try {\n const n = eventsFunctionContext.getArgument(\"n\");\n const col = n.split(\";\");\n\n let r = parseFloat(col[0]),\n g = parseFloat(col[1]),\n b = parseFloat(col[2]);\n\n r = gdjs.evtTools.common.clamp(r, 0, 255);\n g = gdjs.evtTools.common.clamp(g, 0, 255);\n b = gdjs.evtTools.common.clamp(b, 0, 255);\n\n r /= 255;\n g /= 255;\n b /= 255;\n\n let v = Math.max(r, g, b), \n c = v - Math.min(r, g, b);\n\n let h = c && ((v == r) ? (g - b) / c: ((v == g) ? 2 + (b - r) / c: 4 + (r - g) / c)); \n\n eventsFunctionContext.returnValue = Math.round(60 * (h < 0 ? h + 6: h)) + ';' + Math.round((v && c / v) * 100) + ';' + Math.round(v * 100);\n} catch (e) {\n console.error(\"Unable to convert a color: \", e);\n eventsFunctionContext.returnValue = \"0;0;0\";\n}", + "inlineCode": [ + "try {", + " const n = eventsFunctionContext.getArgument(\"n\");", + " const col = n.split(\";\");", + "", + " let r = parseFloat(col[0]),", + " g = parseFloat(col[1]),", + " b = parseFloat(col[2]);", + "", + " r = gdjs.evtTools.common.clamp(r, 0, 255);", + " g = gdjs.evtTools.common.clamp(g, 0, 255);", + " b = gdjs.evtTools.common.clamp(b, 0, 255);", + "", + " r /= 255;", + " g /= 255;", + " b /= 255;", + "", + " let v = Math.max(r, g, b), ", + " c = v - Math.min(r, g, b);", + "", + " let h = c && ((v == r) ? (g - b) / c: ((v == g) ? 2 + (b - r) / c: 4 + (r - g) / c)); ", + "", + " eventsFunctionContext.returnValue = Math.round(60 * (h < 0 ? h + 6: h)) + ';' + Math.round((v && c / v) * 100) + ';' + Math.round(v * 100);", + "} catch (e) {", + " console.error(\"Unable to convert a color: \", e);", + " eventsFunctionContext.returnValue = \"0;0;0\";", + "}" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ], + "expressionType": { + "type": "string" + }, "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "RGB value", - "longDescription": "", "name": "n", - "optional": false, - "supplementaryInformation": "", "type": "color" } ], @@ -10602,30 +10697,466 @@ "description": "Converts a color name into a RGB string. (Examples: black, gray, white, red, purple, green, yellow, blue) \nFull list of colors: https://www.w3schools.com/colors/colors_names.asp.", "fullName": "Color name to RGB", "functionType": "StringExpression", - "group": "", "name": "NameToRgb", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "let n = eventsFunctionContext.getArgument(\"n\");\n\nn = n.toLowerCase();\n\nswitch (n) {\n case 'black':\n eventsFunctionContext.returnValue = '0;0;0';\n break;\n case 'silver':\n eventsFunctionContext.returnValue = '192;192;192';\n break;\n case 'gray':\n eventsFunctionContext.returnValue = '128;128;128';\n break;\n case 'white':\n eventsFunctionContext.returnValue = '255;255;255';\n break;\n case 'maroon':\n eventsFunctionContext.returnValue = '128;0;0';\n break;\n case 'red':\n eventsFunctionContext.returnValue = '255;0;0';\n break;\n case 'purple':\n eventsFunctionContext.returnValue = '128;0;128';\n break;\n case 'fuchsia':\n eventsFunctionContext.returnValue = '255;0;255';\n break;\n case 'green':\n eventsFunctionContext.returnValue = '0;128;0';\n break;\n case 'lime':\n eventsFunctionContext.returnValue = '0;255;0';\n break;\n case 'olive':\n eventsFunctionContext.returnValue = '128;128;0';\n break;\n case 'yellow':\n eventsFunctionContext.returnValue = '255;255;0';\n break;\n case 'navy':\n eventsFunctionContext.returnValue = '0;0;128';\n break;\n case 'blue':\n eventsFunctionContext.returnValue = '0;0;255';\n break;\n case 'teal':\n eventsFunctionContext.returnValue = '0;128;128';\n break;\n case 'aqua':\n eventsFunctionContext.returnValue = '0;255;255';\n break;\n case 'orange':\n eventsFunctionContext.returnValue = '255;165;0';\n break;\n case 'aliceblue':\n eventsFunctionContext.returnValue = '240;248;255';\n break;\n case 'antiquewhite':\n eventsFunctionContext.returnValue = '250;235;215';\n break;\n case 'aquamarine':\n eventsFunctionContext.returnValue = '127;255;212';\n break;\n case 'azure':\n eventsFunctionContext.returnValue = '240;255;255';\n break;\n case 'beige':\n eventsFunctionContext.returnValue = '245;245;220';\n break;\n case 'bisque':\n eventsFunctionContext.returnValue = '255;228;196';\n break;\n case 'blanchedalmond':\n eventsFunctionContext.returnValue = '255;235;205';\n break;\n case 'blueviolet':\n eventsFunctionContext.returnValue = '128;43;226';\n break;\n case 'brown':\n eventsFunctionContext.returnValue = '165;42;42';\n break;\n case 'burlywood':\n eventsFunctionContext.returnValue = '222;184;135';\n break;\n case 'cadetblue':\n eventsFunctionContext.returnValue = '95;158;160';\n break;\n case 'chartreuse':\n eventsFunctionContext.returnValue = '127;255;0';\n break;\n case 'chocolate':\n eventsFunctionContext.returnValue = '210;105;30';\n break;\n case 'coral':\n eventsFunctionContext.returnValue = '255;127;80';\n break;\n case 'cornflowerblue':\n eventsFunctionContext.returnValue = '100;149;237';\n break;\n case 'cornsilk':\n eventsFunctionContext.returnValue = '255;248;220';\n break;\n case 'crimson':\n eventsFunctionContext.returnValue = '220;20;60';\n break;\n case 'cyan':\n eventsFunctionContext.returnValue = '220;20;60';\n break;\n case 'darkblue':\n eventsFunctionContext.returnValue = '0;0;139';\n break;\n case 'darkcyan':\n eventsFunctionContext.returnValue = '0;139;139';\n break;\n case 'darkgoldenrod':\n eventsFunctionContext.returnValue = '184;134;11';\n break;\n case 'darkgray':\n case 'darkgrey':\n eventsFunctionContext.returnValue = '169;169;169';\n break;\n case 'darkgreen':\n eventsFunctionContext.returnValue = '0;100;0';\n break;\n case 'darkkhaki':\n eventsFunctionContext.returnValue = '189;183;107';\n break;\n case 'darkmagenta':\n eventsFunctionContext.returnValue = '139;0;139';\n break;\n case 'darkolivegreen':\n eventsFunctionContext.returnValue = '85;107;47';\n break;\n case 'darkorange':\n eventsFunctionContext.returnValue = '255;140;0';\n break;\n case 'darkorchid':\n eventsFunctionContext.returnValue = '153;50;204';\n break;\n case 'darkred':\n eventsFunctionContext.returnValue = '139;0;0';\n break;\n case 'darksalmon':\n eventsFunctionContext.returnValue = '233;150;122';\n break;\n case 'darkseagreen':\n eventsFunctionContext.returnValue = '143;188;143';\n break;\n case 'darkslateblue':\n eventsFunctionContext.returnValue = '72;61;139';\n break;\n case 'darkslategray':\n case 'darkslategrey':\n eventsFunctionContext.returnValue = '47;79;79';\n break;\n case 'darkturquoise':\n eventsFunctionContext.returnValue = '0;206;209';\n break;\n case 'darkviolet':\n eventsFunctionContext.returnValue = '148;0;211';\n break;\n case 'deeppink':\n eventsFunctionContext.returnValue = '255;20;147';\n break;\n case 'deepskyblue':\n eventsFunctionContext.returnValue = '0;191;255';\n break;\n case 'dimgray':\n case 'dimgrey':\n eventsFunctionContext.returnValue = '105;105;105';\n break;\n case 'dodgerblue':\n eventsFunctionContext.returnValue = '30;144;255';\n break;\n case 'firebrick':\n eventsFunctionContext.returnValue = '178;34;34';\n break;\n case 'floralwhite':\n eventsFunctionContext.returnValue = '255;250;240';\n break;\n case 'forestgreen':\n eventsFunctionContext.returnValue = '32;139;34';\n break;\n case 'gainsboro':\n eventsFunctionContext.returnValue = '220;220;220';\n break;\n case 'ghostwhite':\n eventsFunctionContext.returnValue = '248;248;255';\n break;\n case 'gold':\n eventsFunctionContext.returnValue = '255;215;0';\n break;\n case 'goldenrod':\n eventsFunctionContext.returnValue = '218;165;32';\n break;\n case 'greenyellow':\n eventsFunctionContext.returnValue = '173;255;47';\n break;\n case 'grey':\n eventsFunctionContext.returnValue = '128;128;128';\n break;\n case 'honeydew':\n eventsFunctionContext.returnValue = '240;255;240';\n break;\n case 'hotpink':\n eventsFunctionContext.returnValue = '255;105;180';\n break;\n case 'indianred':\n eventsFunctionContext.returnValue = '205;92;92';\n break;\n case 'indigo':\n eventsFunctionContext.returnValue = '75;0;130';\n break;\n case 'ivory':\n eventsFunctionContext.returnValue = '255;255;240';\n break;\n case 'khaki':\n eventsFunctionContext.returnValue = '240;230;140';\n break;\n case 'lavender':\n eventsFunctionContext.returnValue = '230;230;250';\n break;\n case 'lavenderblush':\n eventsFunctionContext.returnValue = '255;240;245';\n break;\n case 'lawngreen':\n eventsFunctionContext.returnValue = '124;252;0';\n break;\n case 'lemonchiffon':\n eventsFunctionContext.returnValue = '255;250;205';\n break;\n case 'lightblue':\n eventsFunctionContext.returnValue = '173;216;230';\n break;\n case 'lightcoral':\n eventsFunctionContext.returnValue = '240;128;128';\n break;\n case 'lightcyan':\n eventsFunctionContext.returnValue = '224;255;255';\n break;\n case 'lightgoldenrodyellow':\n eventsFunctionContext.returnValue = '250;250;210';\n break;\n case 'lightgray':\n case 'lightgrey':\n eventsFunctionContext.returnValue = '211;211;211';\n break;\n case 'lightgreen':\n eventsFunctionContext.returnValue = '144;238;144';\n break;\n case 'lightpink':\n eventsFunctionContext.returnValue = '255;182;193';\n break;\n case 'lightsalmon':\n eventsFunctionContext.returnValue = '255;160;122';\n break;\n case 'lightseagreen':\n eventsFunctionContext.returnValue = '32;178;170';\n break;\n case 'lightskyblue':\n eventsFunctionContext.returnValue = '135;206;250';\n break;\n case 'lightslategray':\n case 'lightslategrey':\n eventsFunctionContext.returnValue = '119;136;153';\n break;\n case 'lightsteelblue':\n eventsFunctionContext.returnValue = '176;196;222';\n break;\n case 'lightyellow':\n eventsFunctionContext.returnValue = '255;255;224';\n break;\n case 'limegreen':\n eventsFunctionContext.returnValue = '50;205;50';\n break;\n case 'linen':\n eventsFunctionContext.returnValue = '250;240;230';\n break;\n case 'magenta':\n eventsFunctionContext.returnValue = '255;0;255';\n break;\n case 'mediumaquamarine':\n eventsFunctionContext.returnValue = '102;205;170';\n break;\n case 'mediumblue':\n eventsFunctionContext.returnValue = '0;0;205';\n break;\n case 'mediumorchid':\n eventsFunctionContext.returnValue = '186;85;211';\n break;\n case 'mediumpurple':\n eventsFunctionContext.returnValue = '147;112;219';\n break;\n case 'mediumseagreen':\n eventsFunctionContext.returnValue = '60;179;113';\n break;\n case 'mediumslateblue':\n eventsFunctionContext.returnValue = '123;104;238';\n break;\n case 'mediumspringgreen':\n eventsFunctionContext.returnValue = '0;250;154';\n break;\n case 'mediumturquoise':\n eventsFunctionContext.returnValue = '72;209;204';\n break;\n case 'mediumvioletred':\n eventsFunctionContext.returnValue = '199;21;133';\n break;\n case 'midnightblue':\n eventsFunctionContext.returnValue = '25;25;112';\n break;\n case 'mintcream':\n eventsFunctionContext.returnValue = '245;255;250';\n break;\n case 'mistyrose':\n eventsFunctionContext.returnValue = '255;228;225';\n break;\n case 'moccasin':\n eventsFunctionContext.returnValue = '255;228;181';\n break;\n case 'navajowhite':\n eventsFunctionContext.returnValue = '255;222;173';\n break;\n case 'oldlace':\n eventsFunctionContext.returnValue = '253;245;230';\n break;\n case 'olivedrab':\n eventsFunctionContext.returnValue = '107;142;35';\n break;\n case 'orangered':\n eventsFunctionContext.returnValue = '255;69;0';\n break;\n case 'orchid':\n eventsFunctionContext.returnValue = '218;112;214';\n break;\n case 'palegoldenrod':\n eventsFunctionContext.returnValue = '238;232;170';\n break;\n case 'palegreen':\n eventsFunctionContext.returnValue = '152;251;152';\n break;\n case 'paleturquoise':\n eventsFunctionContext.returnValue = '175;238;238';\n break;\n case 'palevioletred':\n eventsFunctionContext.returnValue = '219;112;147';\n break;\n case 'papayawhip':\n eventsFunctionContext.returnValue = '255;239;213';\n break;\n case 'peachpuff':\n eventsFunctionContext.returnValue = '255;218;185';\n break;\n case 'peru':\n eventsFunctionContext.returnValue = '205;133;63';\n break;\n case 'pink':\n eventsFunctionContext.returnValue = '255;192;203';\n break;\n case 'plum':\n eventsFunctionContext.returnValue = '221;160;221';\n break;\n case 'powderblue':\n eventsFunctionContext.returnValue = '176;224;230';\n break;\n case 'rosybrown':\n eventsFunctionContext.returnValue = '188;143;143';\n break;\n case 'royalblue':\n eventsFunctionContext.returnValue = '65;105;225';\n break;\n case 'saddlebrown':\n eventsFunctionContext.returnValue = '139;69;19';\n break;\n case 'salmon':\n eventsFunctionContext.returnValue = '150;128;114';\n break;\n case 'sandybrown':\n eventsFunctionContext.returnValue = '244;164;96';\n break;\n case 'seagreen':\n eventsFunctionContext.returnValue = '46;139;87';\n break;\n case 'seashell':\n eventsFunctionContext.returnValue = '255;245;238';\n break;\n case 'sienna':\n eventsFunctionContext.returnValue = '160;82;45';\n break;\n case 'skyblue':\n eventsFunctionContext.returnValue = '135;206;235';\n break;\n case 'slateblue':\n eventsFunctionContext.returnValue = '106;90;205';\n break;\n case 'slategray':\n case 'slategrey':\n eventsFunctionContext.returnValue = '112;128;144';\n break;\n case 'snow':\n eventsFunctionContext.returnValue = '255;250;250';\n break;\n case 'springgreen':\n eventsFunctionContext.returnValue = '0;255;127';\n break;\n case 'steelblue':\n eventsFunctionContext.returnValue = '70;130;180';\n break;\n case 'tan':\n eventsFunctionContext.returnValue = '210;180;140';\n break;\n case 'thistle':\n eventsFunctionContext.returnValue = '216;191;216';\n break;\n case 'tomato':\n eventsFunctionContext.returnValue = '255;99;71';\n break;\n case 'turquoise':\n eventsFunctionContext.returnValue = '64;224;208';\n break;\n case 'violet':\n eventsFunctionContext.returnValue = '238;130;238';\n break;\n case 'wheat':\n eventsFunctionContext.returnValue = '245;222;179';\n break;\n case 'whitesmoke':\n eventsFunctionContext.returnValue = '245;245;245';\n break;\n case 'yellowgreen':\n eventsFunctionContext.returnValue = '154;205;50';\n break;\n case 'rebeccapurple':\n eventsFunctionContext.returnValue = '102;51;153';\n break;\n default:\n eventsFunctionContext.returnValue = '0;0;0';\n console.error(\"Not a vaild color name\"); \n}", + "inlineCode": [ + "let n = eventsFunctionContext.getArgument(\"n\");", + "", + "n = n.toLowerCase();", + "", + "switch (n) {", + " case 'black':", + " eventsFunctionContext.returnValue = '0;0;0';", + " break;", + " case 'silver':", + " eventsFunctionContext.returnValue = '192;192;192';", + " break;", + " case 'gray':", + " eventsFunctionContext.returnValue = '128;128;128';", + " break;", + " case 'white':", + " eventsFunctionContext.returnValue = '255;255;255';", + " break;", + " case 'maroon':", + " eventsFunctionContext.returnValue = '128;0;0';", + " break;", + " case 'red':", + " eventsFunctionContext.returnValue = '255;0;0';", + " break;", + " case 'purple':", + " eventsFunctionContext.returnValue = '128;0;128';", + " break;", + " case 'fuchsia':", + " eventsFunctionContext.returnValue = '255;0;255';", + " break;", + " case 'green':", + " eventsFunctionContext.returnValue = '0;128;0';", + " break;", + " case 'lime':", + " eventsFunctionContext.returnValue = '0;255;0';", + " break;", + " case 'olive':", + " eventsFunctionContext.returnValue = '128;128;0';", + " break;", + " case 'yellow':", + " eventsFunctionContext.returnValue = '255;255;0';", + " break;", + " case 'navy':", + " eventsFunctionContext.returnValue = '0;0;128';", + " break;", + " case 'blue':", + " eventsFunctionContext.returnValue = '0;0;255';", + " break;", + " case 'teal':", + " eventsFunctionContext.returnValue = '0;128;128';", + " break;", + " case 'aqua':", + " eventsFunctionContext.returnValue = '0;255;255';", + " break;", + " case 'orange':", + " eventsFunctionContext.returnValue = '255;165;0';", + " break;", + " case 'aliceblue':", + " eventsFunctionContext.returnValue = '240;248;255';", + " break;", + " case 'antiquewhite':", + " eventsFunctionContext.returnValue = '250;235;215';", + " break;", + " case 'aquamarine':", + " eventsFunctionContext.returnValue = '127;255;212';", + " break;", + " case 'azure':", + " eventsFunctionContext.returnValue = '240;255;255';", + " break;", + " case 'beige':", + " eventsFunctionContext.returnValue = '245;245;220';", + " break;", + " case 'bisque':", + " eventsFunctionContext.returnValue = '255;228;196';", + " break;", + " case 'blanchedalmond':", + " eventsFunctionContext.returnValue = '255;235;205';", + " break;", + " case 'blueviolet':", + " eventsFunctionContext.returnValue = '128;43;226';", + " break;", + " case 'brown':", + " eventsFunctionContext.returnValue = '165;42;42';", + " break;", + " case 'burlywood':", + " eventsFunctionContext.returnValue = '222;184;135';", + " break;", + " case 'cadetblue':", + " eventsFunctionContext.returnValue = '95;158;160';", + " break;", + " case 'chartreuse':", + " eventsFunctionContext.returnValue = '127;255;0';", + " break;", + " case 'chocolate':", + " eventsFunctionContext.returnValue = '210;105;30';", + " break;", + " case 'coral':", + " eventsFunctionContext.returnValue = '255;127;80';", + " break;", + " case 'cornflowerblue':", + " eventsFunctionContext.returnValue = '100;149;237';", + " break;", + " case 'cornsilk':", + " eventsFunctionContext.returnValue = '255;248;220';", + " break;", + " case 'crimson':", + " eventsFunctionContext.returnValue = '220;20;60';", + " break;", + " case 'cyan':", + " eventsFunctionContext.returnValue = '220;20;60';", + " break;", + " case 'darkblue':", + " eventsFunctionContext.returnValue = '0;0;139';", + " break;", + " case 'darkcyan':", + " eventsFunctionContext.returnValue = '0;139;139';", + " break;", + " case 'darkgoldenrod':", + " eventsFunctionContext.returnValue = '184;134;11';", + " break;", + " case 'darkgray':", + " case 'darkgrey':", + " eventsFunctionContext.returnValue = '169;169;169';", + " break;", + " case 'darkgreen':", + " eventsFunctionContext.returnValue = '0;100;0';", + " break;", + " case 'darkkhaki':", + " eventsFunctionContext.returnValue = '189;183;107';", + " break;", + " case 'darkmagenta':", + " eventsFunctionContext.returnValue = '139;0;139';", + " break;", + " case 'darkolivegreen':", + " eventsFunctionContext.returnValue = '85;107;47';", + " break;", + " case 'darkorange':", + " eventsFunctionContext.returnValue = '255;140;0';", + " break;", + " case 'darkorchid':", + " eventsFunctionContext.returnValue = '153;50;204';", + " break;", + " case 'darkred':", + " eventsFunctionContext.returnValue = '139;0;0';", + " break;", + " case 'darksalmon':", + " eventsFunctionContext.returnValue = '233;150;122';", + " break;", + " case 'darkseagreen':", + " eventsFunctionContext.returnValue = '143;188;143';", + " break;", + " case 'darkslateblue':", + " eventsFunctionContext.returnValue = '72;61;139';", + " break;", + " case 'darkslategray':", + " case 'darkslategrey':", + " eventsFunctionContext.returnValue = '47;79;79';", + " break;", + " case 'darkturquoise':", + " eventsFunctionContext.returnValue = '0;206;209';", + " break;", + " case 'darkviolet':", + " eventsFunctionContext.returnValue = '148;0;211';", + " break;", + " case 'deeppink':", + " eventsFunctionContext.returnValue = '255;20;147';", + " break;", + " case 'deepskyblue':", + " eventsFunctionContext.returnValue = '0;191;255';", + " break;", + " case 'dimgray':", + " case 'dimgrey':", + " eventsFunctionContext.returnValue = '105;105;105';", + " break;", + " case 'dodgerblue':", + " eventsFunctionContext.returnValue = '30;144;255';", + " break;", + " case 'firebrick':", + " eventsFunctionContext.returnValue = '178;34;34';", + " break;", + " case 'floralwhite':", + " eventsFunctionContext.returnValue = '255;250;240';", + " break;", + " case 'forestgreen':", + " eventsFunctionContext.returnValue = '32;139;34';", + " break;", + " case 'gainsboro':", + " eventsFunctionContext.returnValue = '220;220;220';", + " break;", + " case 'ghostwhite':", + " eventsFunctionContext.returnValue = '248;248;255';", + " break;", + " case 'gold':", + " eventsFunctionContext.returnValue = '255;215;0';", + " break;", + " case 'goldenrod':", + " eventsFunctionContext.returnValue = '218;165;32';", + " break;", + " case 'greenyellow':", + " eventsFunctionContext.returnValue = '173;255;47';", + " break;", + " case 'grey':", + " eventsFunctionContext.returnValue = '128;128;128';", + " break;", + " case 'honeydew':", + " eventsFunctionContext.returnValue = '240;255;240';", + " break;", + " case 'hotpink':", + " eventsFunctionContext.returnValue = '255;105;180';", + " break;", + " case 'indianred':", + " eventsFunctionContext.returnValue = '205;92;92';", + " break;", + " case 'indigo':", + " eventsFunctionContext.returnValue = '75;0;130';", + " break;", + " case 'ivory':", + " eventsFunctionContext.returnValue = '255;255;240';", + " break;", + " case 'khaki':", + " eventsFunctionContext.returnValue = '240;230;140';", + " break;", + " case 'lavender':", + " eventsFunctionContext.returnValue = '230;230;250';", + " break;", + " case 'lavenderblush':", + " eventsFunctionContext.returnValue = '255;240;245';", + " break;", + " case 'lawngreen':", + " eventsFunctionContext.returnValue = '124;252;0';", + " break;", + " case 'lemonchiffon':", + " eventsFunctionContext.returnValue = '255;250;205';", + " break;", + " case 'lightblue':", + " eventsFunctionContext.returnValue = '173;216;230';", + " break;", + " case 'lightcoral':", + " eventsFunctionContext.returnValue = '240;128;128';", + " break;", + " case 'lightcyan':", + " eventsFunctionContext.returnValue = '224;255;255';", + " break;", + " case 'lightgoldenrodyellow':", + " eventsFunctionContext.returnValue = '250;250;210';", + " break;", + " case 'lightgray':", + " case 'lightgrey':", + " eventsFunctionContext.returnValue = '211;211;211';", + " break;", + " case 'lightgreen':", + " eventsFunctionContext.returnValue = '144;238;144';", + " break;", + " case 'lightpink':", + " eventsFunctionContext.returnValue = '255;182;193';", + " break;", + " case 'lightsalmon':", + " eventsFunctionContext.returnValue = '255;160;122';", + " break;", + " case 'lightseagreen':", + " eventsFunctionContext.returnValue = '32;178;170';", + " break;", + " case 'lightskyblue':", + " eventsFunctionContext.returnValue = '135;206;250';", + " break;", + " case 'lightslategray':", + " case 'lightslategrey':", + " eventsFunctionContext.returnValue = '119;136;153';", + " break;", + " case 'lightsteelblue':", + " eventsFunctionContext.returnValue = '176;196;222';", + " break;", + " case 'lightyellow':", + " eventsFunctionContext.returnValue = '255;255;224';", + " break;", + " case 'limegreen':", + " eventsFunctionContext.returnValue = '50;205;50';", + " break;", + " case 'linen':", + " eventsFunctionContext.returnValue = '250;240;230';", + " break;", + " case 'magenta':", + " eventsFunctionContext.returnValue = '255;0;255';", + " break;", + " case 'mediumaquamarine':", + " eventsFunctionContext.returnValue = '102;205;170';", + " break;", + " case 'mediumblue':", + " eventsFunctionContext.returnValue = '0;0;205';", + " break;", + " case 'mediumorchid':", + " eventsFunctionContext.returnValue = '186;85;211';", + " break;", + " case 'mediumpurple':", + " eventsFunctionContext.returnValue = '147;112;219';", + " break;", + " case 'mediumseagreen':", + " eventsFunctionContext.returnValue = '60;179;113';", + " break;", + " case 'mediumslateblue':", + " eventsFunctionContext.returnValue = '123;104;238';", + " break;", + " case 'mediumspringgreen':", + " eventsFunctionContext.returnValue = '0;250;154';", + " break;", + " case 'mediumturquoise':", + " eventsFunctionContext.returnValue = '72;209;204';", + " break;", + " case 'mediumvioletred':", + " eventsFunctionContext.returnValue = '199;21;133';", + " break;", + " case 'midnightblue':", + " eventsFunctionContext.returnValue = '25;25;112';", + " break;", + " case 'mintcream':", + " eventsFunctionContext.returnValue = '245;255;250';", + " break;", + " case 'mistyrose':", + " eventsFunctionContext.returnValue = '255;228;225';", + " break;", + " case 'moccasin':", + " eventsFunctionContext.returnValue = '255;228;181';", + " break;", + " case 'navajowhite':", + " eventsFunctionContext.returnValue = '255;222;173';", + " break;", + " case 'oldlace':", + " eventsFunctionContext.returnValue = '253;245;230';", + " break;", + " case 'olivedrab':", + " eventsFunctionContext.returnValue = '107;142;35';", + " break;", + " case 'orangered':", + " eventsFunctionContext.returnValue = '255;69;0';", + " break;", + " case 'orchid':", + " eventsFunctionContext.returnValue = '218;112;214';", + " break;", + " case 'palegoldenrod':", + " eventsFunctionContext.returnValue = '238;232;170';", + " break;", + " case 'palegreen':", + " eventsFunctionContext.returnValue = '152;251;152';", + " break;", + " case 'paleturquoise':", + " eventsFunctionContext.returnValue = '175;238;238';", + " break;", + " case 'palevioletred':", + " eventsFunctionContext.returnValue = '219;112;147';", + " break;", + " case 'papayawhip':", + " eventsFunctionContext.returnValue = '255;239;213';", + " break;", + " case 'peachpuff':", + " eventsFunctionContext.returnValue = '255;218;185';", + " break;", + " case 'peru':", + " eventsFunctionContext.returnValue = '205;133;63';", + " break;", + " case 'pink':", + " eventsFunctionContext.returnValue = '255;192;203';", + " break;", + " case 'plum':", + " eventsFunctionContext.returnValue = '221;160;221';", + " break;", + " case 'powderblue':", + " eventsFunctionContext.returnValue = '176;224;230';", + " break;", + " case 'rosybrown':", + " eventsFunctionContext.returnValue = '188;143;143';", + " break;", + " case 'royalblue':", + " eventsFunctionContext.returnValue = '65;105;225';", + " break;", + " case 'saddlebrown':", + " eventsFunctionContext.returnValue = '139;69;19';", + " break;", + " case 'salmon':", + " eventsFunctionContext.returnValue = '150;128;114';", + " break;", + " case 'sandybrown':", + " eventsFunctionContext.returnValue = '244;164;96';", + " break;", + " case 'seagreen':", + " eventsFunctionContext.returnValue = '46;139;87';", + " break;", + " case 'seashell':", + " eventsFunctionContext.returnValue = '255;245;238';", + " break;", + " case 'sienna':", + " eventsFunctionContext.returnValue = '160;82;45';", + " break;", + " case 'skyblue':", + " eventsFunctionContext.returnValue = '135;206;235';", + " break;", + " case 'slateblue':", + " eventsFunctionContext.returnValue = '106;90;205';", + " break;", + " case 'slategray':", + " case 'slategrey':", + " eventsFunctionContext.returnValue = '112;128;144';", + " break;", + " case 'snow':", + " eventsFunctionContext.returnValue = '255;250;250';", + " break;", + " case 'springgreen':", + " eventsFunctionContext.returnValue = '0;255;127';", + " break;", + " case 'steelblue':", + " eventsFunctionContext.returnValue = '70;130;180';", + " break;", + " case 'tan':", + " eventsFunctionContext.returnValue = '210;180;140';", + " break;", + " case 'thistle':", + " eventsFunctionContext.returnValue = '216;191;216';", + " break;", + " case 'tomato':", + " eventsFunctionContext.returnValue = '255;99;71';", + " break;", + " case 'turquoise':", + " eventsFunctionContext.returnValue = '64;224;208';", + " break;", + " case 'violet':", + " eventsFunctionContext.returnValue = '238;130;238';", + " break;", + " case 'wheat':", + " eventsFunctionContext.returnValue = '245;222;179';", + " break;", + " case 'whitesmoke':", + " eventsFunctionContext.returnValue = '245;245;245';", + " break;", + " case 'yellowgreen':", + " eventsFunctionContext.returnValue = '154;205;50';", + " break;", + " case 'rebeccapurple':", + " eventsFunctionContext.returnValue = '102;51;153';", + " break;", + " default:", + " eventsFunctionContext.returnValue = '0;0;0';", + " console.error(\"Not a vaild color name\"); ", + "}" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ], + "expressionType": { + "type": "string" + }, "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Name of a color", - "longDescription": "", "name": "n", - "optional": false, - "supplementaryInformation": "", "type": "color" } ], @@ -10635,50 +11166,59 @@ "description": "Converts HSL color values into a RGB string. Valid input ranges: H(0 to 360), S(0 to 100), L(0 to 100).", "fullName": "HSL to RGB", "functionType": "StringExpression", - "group": "", "name": "HslToRgb", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "try {\n let h = parseFloat(eventsFunctionContext.getArgument(\"Hue\")),\n s = parseFloat(eventsFunctionContext.getArgument(\"Saturation\")),\n l = parseFloat(eventsFunctionContext.getArgument(\"Lightness\"));\n\n s = gdjs.evtTools.common.clamp(s, 0, 100);\n l = gdjs.evtTools.common.clamp(l, 0, 100);\n\n h %= 360;\n if (h < 0) {\n h += 360;\n }\n\n s /= 100;\n l /= 100;\n\n let a = s * Math.min(l, 1 - l);\n let f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k , 1), - 1); \n\n eventsFunctionContext.returnValue = Math.round(f(0) * 255) + ';' + Math.round(f(8) * 255) + ';' + Math.round(f(4) * 255);\n} catch(e) {\n console.error(\"Unable to convert a color: \", e);\n eventsFunctionContext.returnValue = \"0;0;0\";\n}", + "inlineCode": [ + "try {", + " let h = parseFloat(eventsFunctionContext.getArgument(\"Hue\")),", + " s = parseFloat(eventsFunctionContext.getArgument(\"Saturation\")),", + " l = parseFloat(eventsFunctionContext.getArgument(\"Lightness\"));", + "", + " s = gdjs.evtTools.common.clamp(s, 0, 100);", + " l = gdjs.evtTools.common.clamp(l, 0, 100);", + "", + " h %= 360;", + " if (h < 0) {", + " h += 360;", + " }", + "", + " s /= 100;", + " l /= 100;", + "", + " let a = s * Math.min(l, 1 - l);", + " let f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k , 1), - 1); ", + "", + " eventsFunctionContext.returnValue = Math.round(f(0) * 255) + ';' + Math.round(f(8) * 255) + ';' + Math.round(f(4) * 255);", + "} catch(e) {", + " console.error(\"Unable to convert a color: \", e);", + " eventsFunctionContext.returnValue = \"0;0;0\";", + "}" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ], + "expressionType": { + "type": "string" + }, "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Hue 0-360", - "longDescription": "", "name": "Hue", - "optional": false, - "supplementaryInformation": "", "type": "expression" }, { - "codeOnly": false, - "defaultValue": "", "description": "Saturation 0-100", - "longDescription": "", "name": "Saturation", - "optional": false, - "supplementaryInformation": "", "type": "expression" }, { - "codeOnly": false, - "defaultValue": "", "description": "Lightness 0-100", - "longDescription": "", "name": "Lightness", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -10688,42 +11228,58 @@ "description": "Converts a color hue (range: 0 to 360) into an RGB color string with 100% saturation and 50% lightness.", "fullName": "Hue to RGB", "functionType": "StringExpression", - "group": "", "name": "HueToRgb", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "try {\n let h = parseFloat(eventsFunctionContext.getArgument(\"Hue\")),\n s = 100,\n l = 50;\n\n s /= 100;\n l /= 100;\n\n h %= 360;\n if (h < 0) {\n h += 360;\n }\n\n let a = s * Math.min(l, 1 - l);\n let f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k , 1), - 1); \n\n eventsFunctionContext.returnValue = Math.round(f(0) * 255) + ';' + Math.round(f(8) * 255) + ';' + Math.round(f(4) * 255);\n} catch(e) {\n console.error(\"Unable to convert a color: \", e);\n eventsFunctionContext.returnValue = \"0;0;0\";\n}", + "inlineCode": [ + "try {", + " let h = parseFloat(eventsFunctionContext.getArgument(\"Hue\")),", + " s = 100,", + " l = 50;", + "", + " s /= 100;", + " l /= 100;", + "", + " h %= 360;", + " if (h < 0) {", + " h += 360;", + " }", + "", + " let a = s * Math.min(l, 1 - l);", + " let f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k , 1), - 1); ", + "", + " eventsFunctionContext.returnValue = Math.round(f(0) * 255) + ';' + Math.round(f(8) * 255) + ';' + Math.round(f(4) * 255);", + "} catch(e) {", + " console.error(\"Unable to convert a color: \", e);", + " eventsFunctionContext.returnValue = \"0;0;0\";", + "}" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ], + "expressionType": { + "type": "string" + }, "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Hue 0-360", - "longDescription": "", "name": "Hue", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], "objectGroups": [] } ], - "eventsBasedBehaviors": [] + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] }, { "author": "", - "category": "", - "description": "This extension allows to restyle a sprite, a tiled sprite or a panel sprite.\n\nIt can be used to:\n- Change the color of player short according to its team color.\n- Add small color variation to trees of a forest.\n- Restyle objects to match other assets.\n\nThis extension is experimental and might no longer work in future version of GDevelop.", + "category": "Visual effect", "extensionNamespace": "", "fullName": "Object recolorizer (experimental)", "helpPath": "", @@ -10732,14 +11288,30 @@ "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Graphic Design/Graphic Design_color_colour_palette_paint_brush.svg", "shortDescription": "Independently change the colors of a sprite, a tiled sprite or a panel sprite.", "version": "0.1.1", + "description": [ + "This extension allows to restyle a sprite, a tiled sprite or a panel sprite.", + "", + "It can be used to:", + "- Change the color of player short according to its team color.", + "- Add small color variation to trees of a forest.", + "- Restyle objects to match other assets.", + "", + "An example shows how to change the 2 main colors of an object ([open the project online](https://editor.gdevelop.io/?project=example://recolorizer)).", + "", + "This extension is experimental and might no longer work in future version of GDevelop." + ], + "origin": { + "identifier": "Recolorizer", + "name": "gdevelop-extension-store" + }, "tags": [ "color", "hue", "saturation", "lightness", - "HSL", - "HSV", - "RGB" + "hsl", + "hsv", + "rgb" ], "authorIds": [ "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" @@ -10750,47 +11322,434 @@ "description": "Define JavaScript classes.", "fullName": "Define JavaScript classes", "functionType": "Action", - "group": "", "name": "DefineJavaScript", "private": true, "sentence": "Define JavaScript classes", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": false, "value": "GlobalVariableAsBoolean" }, "parameters": [ "__Recolorizer_IsDefined", "False" - ], - "subInstructions": [] + ] } ], "actions": [ { "type": { - "inverted": false, "value": "SetGlobalVariableAsBoolean" }, "parameters": [ "__Recolorizer_IsDefined", "True" - ], - "subInstructions": [] + ] } ], "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "/**\n * Converts an HSL color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\n * Assumes h, s, and l are contained in the set [0, 1] and\n * returns r, g, and b in the set [0, 255].\n * https://stackoverflow.com/questions/2353211/hsl-to-rgb-color-conversion\n *\n * @param {number} h The hue\n * @param {number} s The saturation\n * @param {number} l The lightness\n * @return {number[]} The RGB representation\n */\nconst hslToRgb = function (h, s, l) {\n var r, g, b;\n\n if (s == 0) {\n r = g = b = l; // achromatic\n } else {\n var hue2rgb = function hue2rgb(p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n }\n\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n\n return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)];\n}\n\n/**\n * Converts an RGB color value to HSL. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\n * Assumes r, g, and b are contained in the set [0, 255] and\n * returns h, s, and l in the set [0, 1].\n * https://stackoverflow.com/questions/2353211/hsl-to-rgb-color-conversion\n *\n * @param {number} r The red color value\n * @param {number} g The green color value\n * @param {number} b The blue color value\n * @return {number[]} The HSL representation\n */\nconst rgbToHsl = function (r, g, b) {\n r /= 255, g /= 255, b /= 255;\n var max = Math.max(r, g, b), min = Math.min(r, g, b);\n var h, s, l = (max + min) / 2;\n\n if (max == min) {\n h = s = 0; // achromatic\n } else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n\n return [h, s, l];\n}\n\n/**\n * @param {HTMLCanvasElement} canvas\n * @param {PIXI.Texture} texture\n * @returns {HTMLCanvasElement}\n */\nconst resetCanvas = function (canvas, texture) {\n const context = canvas.getContext('2d');\n const crop = texture._frame;\n context.save();\n context.globalCompositeOperation = 'copy';\n context.drawImage(\n texture.baseTexture.getDrawableSource(),\n crop.x,\n crop.y,\n crop.width,\n crop.height,\n 0,\n 0,\n crop.width,\n crop.height\n );\n context.restore();\n return canvas;\n}\n\n/**\n * Replace a color with an other one.\n *\n * @param {HTMLCanvasElement} sourceCanvas\n * @param {HTMLCanvasElement} targetCanvas\n * @param {{x: number, y: number, width: number, height: number}} frame\n * @param {[number, number, number]} originColor The color to replace from.\n * @param {[number, number, number]} targetColor The color to replate to.\n * @param {number} hueScope Pixels within the hue scope relatively from originColor are recolorized.\n * @param {number} saturationScope Pixels within the saturation scope relatively from originColor are recolorized.\n * @param {number} lighnessScope Pixels within the lightness scope relatively from originColor are recolorized.\n */\nconst recolorizeTexture = function (sourceCanvas, targetCanvas, frame, originColor, targetColor, hueScope, saturationScope, lighnessScope) {\n const sourceContext = sourceCanvas.getContext('2d');\n const targetContext = targetCanvas.getContext('2d');\n const sourcePixels = sourceContext.getImageData(0, 0, frame.width, frame.height).data;\n const targetImageData = targetContext.getImageData(0, 0, frame.width, frame.height);\n const targetPixels = targetImageData.data;\n\n const originColorHSL = rgbToHsl(originColor[0], originColor[1], originColor[2]);\n const targetColorHSL = rgbToHsl(targetColor[0], targetColor[1], targetColor[2]);\n\n const originHue = originColorHSL[0];\n const originSaturation = originColorHSL[1];\n const originLightness = originColorHSL[2];\n\n const targetHue = targetColorHSL[0];\n const targetSaturation = targetColorHSL[1];\n const saturationDelta = targetSaturation - originSaturation;\n const lightnessDelta = targetColorHSL[2] - originLightness;\n\n // hue is not knowned for graycase colors.\n const hueIsConstrained = hueScope < 0.5;\n\n for (let i = 0; i < sourcePixels.length; i += 4) {\n const pixelHsl = rgbToHsl(sourcePixels[i + 0], sourcePixels[i + 1], sourcePixels[i + 2]);\n\n const pixelHue = pixelHsl[0];\n const pixelSaturation = pixelHsl[1];\n const pixelLightness = pixelHsl[2];\n\n const hueDelta = gdjs.evtTools.common.mod(pixelHue - originHue + 0.5, 1) - 0.5;\n if ((!hueIsConstrained || Math.abs(hueDelta) <= hueScope)\n && Math.abs(pixelSaturation - originSaturation) <= saturationScope\n && Math.abs(pixelLightness - originLightness) <= lighnessScope) {\n // graycase pixels must take the targeted hue\n pixelHsl[0] = pixelSaturation === 0 ? targetHue : gdjs.evtTools.common.mod(pixelHue - originHue + targetHue, 1);\n // white pixels must also take the targeted saturation.\n pixelHsl[1] = pixelLightness > 0.999 ? targetSaturation : gdjs.evtTools.common.clamp(pixelSaturation + saturationDelta, 0, 1);\n pixelHsl[2] = gdjs.evtTools.common.clamp(pixelLightness + lightnessDelta, 0, 1);\n const pixelRgb = hslToRgb(pixelHsl[0], pixelHsl[1], pixelHsl[2]);\n targetPixels[i + 0] = pixelRgb[0];\n targetPixels[i + 1] = pixelRgb[1];\n targetPixels[i + 2] = pixelRgb[2];\n }\n }\n targetContext.putImageData(targetImageData, 0, 0);\n};\n\n/**\n * @param {[number, number, number]} originColor The color to replace from.\n * @param {[number, number, number]} targetColor The color to replate to.\n * @param {number} hueScope Pixels within the hue scope relatively from originColor are recolorized.\n * @param {number} saturationScope Pixels within the saturation scope relatively from originColor are recolorized.\n * @param {number} lighnessScope Pixels within the lightness scope relatively from originColor are recolorized.\n * @return {number} key\n */\nconst getRecolorizationKey = function (originColor, targetColor, hueScope, saturationScope, lighnessScope) {\n return String.fromCharCode(originColor[0] * (2 ** 8) + originColor[1],\n originColor[2] * (2 ** 8) + targetColor[0],\n targetColor[1] * (2 ** 8) + targetColor[2],\n (hueScope * (2 ** 8) + saturationScope) * (2 ** 8),\n lighnessScope * (2 ** 8));\n}\n\ngdjs.__recolorizerExtension = gdjs.__recolorizerExtension || {};\n\n/**\n * @param {PIXI.Texture} texture\n * @returns {HTMLCanvasElement}\n */\ngdjs.__recolorizerExtension.getCanvas = function (texture) {\n /** @type {HTMLCanvasElement} */\n const canvas = document.createElement('canvas');\n\n const context = canvas.getContext('2d');\n const crop = texture._frame.clone();\n const resolution = texture.baseTexture.resolution;\n\n crop.x *= resolution;\n crop.y *= resolution;\n crop.width *= resolution;\n crop.height *= resolution;\n\n canvas.width = Math.ceil(crop.width);\n canvas.height = Math.ceil(crop.height);\n\n context.save();\n context.globalCompositeOperation = 'copy';\n context.drawImage(\n texture.baseTexture.getDrawableSource(),\n crop.x,\n crop.y,\n crop.width,\n crop.height,\n 0,\n 0,\n crop.width,\n crop.height\n );\n context.restore();\n\n return canvas;\n}\n\n/**\n * Manage recolorizations to ensure uniqueness of textures.\n **/\ngdjs.__recolorizerExtension.RecolorizationManager = /** @class */ (function () {\n /**\n * Create a manager.\n * @param {PIXI.Texture[]} sourceTextures\n */\n function RecolorizationManager(sourceTextures) {\n /** @type {PIXI.Texture[]} */\n this.sourceTextures = sourceTextures;\n this.sourceCanvas = sourceTextures.map(texture => gdjs.__recolorizerExtension.getCanvas(texture));\n /** @type {Map} */\n this.recolorizedSprites = new Map();\n /** @type {Array<{userCount: integer, textures: PIXI.Texture[], canvas: HTMLCanvasElement[]}>} */\n this.recycledRecolorizedSprites = [];\n }\n\n /**\n * Unregister a recoloration usage.\n *\n * @param {string} previousRecolorizationKey\n */\n RecolorizationManager.prototype.unregister = function (previousRecolorizationKey) {\n const previousRecolorizedSprite = this.recolorizedSprites.get(previousRecolorizationKey);\n if (previousRecolorizedSprite) {\n previousRecolorizedSprite.userCount--;\n if (previousRecolorizedSprite.userCount <= 0) {\n this.recolorizedSprites.delete(previousRecolorizationKey);\n this.recycledRecolorizedSprites.push(previousRecolorizedSprite);\n }\n }\n }\n\n /**\n * Register a recolorization usage and get recolored textures.\n *\n * @param {string} recolorizationKey\n * @param {Array<{originColor: [number, number, number], targetColor: [number, number, number], hueScope: number, saturationScope: number, lighnessScope: number}>} recolorizations\n * @returns {PIXI.Texture[]} \n */\n RecolorizationManager.prototype.register = function (recolorizationKey, recolorizations) {\n if (recolorizationKey === \"\") {\n return this.sourceTextures;\n }\n\n /** @type {PIXI.Texture[]} */\n let targetTextures;\n let recolorizedSprite = this.recolorizedSprites.get(recolorizationKey);\n if (recolorizedSprite) {\n targetTextures = recolorizedSprite.textures;\n }\n else {\n if (this.recycledRecolorizedSprites.length > 0) {\n const reusableRecolorizedSprite = this.recycledRecolorizedSprites.pop();\n targetTextures = reusableRecolorizedSprite.textures;\n /** @type {PIXI.Texture[]} */\n const targetCanvas = reusableRecolorizedSprite.canvas;\n\n for (let textureIndex = 0; textureIndex < this.sourceTextures.length; textureIndex++) {\n const sourceTexture = this.sourceTextures[textureIndex];\n const targetCanva = targetCanvas[textureIndex];\n resetCanvas(targetCanva, sourceTexture);\n }\n\n this._recolorizeAll(targetCanvas, recolorizations);\n\n targetTextures.forEach(texture => texture.update());\n reusableRecolorizedSprite.userCount = 0;\n recolorizedSprite = reusableRecolorizedSprite;\n }\n else {\n /** @type {PIXI.Texture[]} */\n const targetCanvas = this.sourceTextures.map(texture => gdjs.__recolorizerExtension.getCanvas(texture));\n\n this._recolorizeAll(targetCanvas, recolorizations);\n\n targetTextures = targetCanvas.map(targetCanva => PIXI.Texture.from(targetCanva));\n recolorizedSprite = { userCount: 0, textures: targetTextures, canvas: targetCanvas };\n }\n this.recolorizedSprites.set(recolorizationKey, recolorizedSprite);\n }\n recolorizedSprite.userCount++;\n return targetTextures;\n }\n\n /**\n * Apply a recoloration to every textures.\n *\n * @param {HTMLCanvasElement[]} targetCanvas\n * @param {Array<{originColor: [number, number, number], targetColor: [number, number, number], hueScope: number, saturationScope: number, lighnessScope: number}>} recolorizations\n */\n RecolorizationManager.prototype._recolorizeAll = function (targetCanvas, recolorizations) {\n for (let textureIndex = 0; textureIndex < this.sourceTextures.length; textureIndex++) {\n const sourceTexture = this.sourceTextures[textureIndex];\n const targetCanva = targetCanvas[textureIndex];\n const frame = sourceTexture._frame;\n for (const recolorization of recolorizations) {\n recolorizeTexture(\n this.sourceCanvas[textureIndex],\n targetCanva,\n frame,\n recolorization.originColor,\n recolorization.targetColor,\n recolorization.hueScope,\n recolorization.saturationScope,\n recolorization.lighnessScope\n );\n }\n }\n }\n\n return RecolorizationManager;\n}());\n\n/**\n * Object recolorizer.\n **/\ngdjs.__recolorizerExtension.Recolorizer = /** @class */ (function () {\n /**\n * Create an object recolorizer.\n * @param {gdjs.__recolorizerExtension.RecolorizationManager} manager\n * @param {{texture: PIXI.Texture[]}} sourceTextureConatiners\n */\n function Recolorizer(manager, sourceTextureContainers) {\n this.manager = manager;\n this.sourceTextureContainers = sourceTextureContainers;\n\n this.previousRecolorizationKey = \"\";\n this.recolorizationKey = \"\";\n /** @type {Array<{originColor: [number, number, number], targetColor: [number, number, number], hueScope: number, saturationScope: number, lighnessScope: number}>} */\n this.recolorizations = [];\n }\n\n /**\n * Replace a color with an other one.\n *\n * @param {[number, number, number]} originColor The color to replace from.\n * @param {[number, number, number]} targetColor The color to replate to.\n * @param {number} hueScope Pixels within the hue scope relatively from originColor are recolorized.\n * @param {number} saturationScope Pixels within the saturation scope relatively from originColor are recolorized.\n * @param {number} lighnessScope Pixels within the lightness scope relatively from originColor are recolorized.\n */\n Recolorizer.prototype.recolorizeSprite = function (originColor, targetColor, hueScope, saturationScope, lighnessScope) {\n this.recolorizationKey += getRecolorizationKey(originColor, targetColor, hueScope, saturationScope, lighnessScope);\n this.recolorizations.push({ originColor, targetColor, hueScope, saturationScope, lighnessScope});\n }\n\n /**\n * Reset the default textures of the object.\n */\n Recolorizer.prototype.resetSprite = function () {\n this.recolorizationKey = \"\";\n this.recolorizations = [];\n }\n\n /**\n * Update the textures of the object.\n */\n Recolorizer.prototype.updateSprite = function () {\n const needsRecolorization = this.recolorizationKey !== this.previousRecolorizationKey;\n if (needsRecolorization) {\n this.manager.unregister(this.previousRecolorizationKey);\n\n /** @type {PIXI.Texture[]} */\n const targetTextures = this.manager.register(this.recolorizationKey, this.recolorizations);\n\n let textureIndex = 0;\n for (const container of this.sourceTextureContainers) {\n container.texture = targetTextures[textureIndex];\n textureIndex++;\n }\n this.previousRecolorizationKey = this.recolorizationKey;\n }\n return needsRecolorization;\n }\n\n return Recolorizer;\n}());", + "inlineCode": [ + "/**", + " * Converts an HSL color value to RGB. Conversion formula", + " * adapted from http://en.wikipedia.org/wiki/HSL_color_space.", + " * Assumes h, s, and l are contained in the set [0, 1] and", + " * returns r, g, and b in the set [0, 255].", + " * https://stackoverflow.com/questions/2353211/hsl-to-rgb-color-conversion", + " *", + " * @param {number} h The hue", + " * @param {number} s The saturation", + " * @param {number} l The lightness", + " * @return {number[]} The RGB representation", + " */", + "const hslToRgb = function (h, s, l) {", + " var r, g, b;", + "", + " if (s == 0) {", + " r = g = b = l; // achromatic", + " } else {", + " var hue2rgb = function hue2rgb(p, q, t) {", + " if (t < 0) t += 1;", + " if (t > 1) t -= 1;", + " if (t < 1 / 6) return p + (q - p) * 6 * t;", + " if (t < 1 / 2) return q;", + " if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;", + " return p;", + " }", + "", + " var q = l < 0.5 ? l * (1 + s) : l + s - l * s;", + " var p = 2 * l - q;", + " r = hue2rgb(p, q, h + 1 / 3);", + " g = hue2rgb(p, q, h);", + " b = hue2rgb(p, q, h - 1 / 3);", + " }", + "", + " return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)];", + "}", + "", + "/**", + " * Converts an RGB color value to HSL. Conversion formula", + " * adapted from http://en.wikipedia.org/wiki/HSL_color_space.", + " * Assumes r, g, and b are contained in the set [0, 255] and", + " * returns h, s, and l in the set [0, 1].", + " * https://stackoverflow.com/questions/2353211/hsl-to-rgb-color-conversion", + " *", + " * @param {number} r The red color value", + " * @param {number} g The green color value", + " * @param {number} b The blue color value", + " * @return {number[]} The HSL representation", + " */", + "const rgbToHsl = function (r, g, b) {", + " r /= 255, g /= 255, b /= 255;", + " var max = Math.max(r, g, b), min = Math.min(r, g, b);", + " var h, s, l = (max + min) / 2;", + "", + " if (max == min) {", + " h = s = 0; // achromatic", + " } else {", + " var d = max - min;", + " s = l > 0.5 ? d / (2 - max - min) : d / (max + min);", + " switch (max) {", + " case r: h = (g - b) / d + (g < b ? 6 : 0); break;", + " case g: h = (b - r) / d + 2; break;", + " case b: h = (r - g) / d + 4; break;", + " }", + " h /= 6;", + " }", + "", + " return [h, s, l];", + "}", + "", + "/**", + " * @param {HTMLCanvasElement} canvas", + " * @param {PIXI.Texture} texture", + " * @returns {HTMLCanvasElement}", + " */", + "const resetCanvas = function (canvas, texture) {", + " const context = canvas.getContext('2d');", + " const crop = texture._frame;", + " context.save();", + " context.globalCompositeOperation = 'copy';", + " context.drawImage(", + " texture.baseTexture.getDrawableSource(),", + " crop.x,", + " crop.y,", + " crop.width,", + " crop.height,", + " 0,", + " 0,", + " crop.width,", + " crop.height", + " );", + " context.restore();", + " return canvas;", + "}", + "", + "/**", + " * Replace a color with an other one.", + " *", + " * @param {HTMLCanvasElement} sourceCanvas", + " * @param {HTMLCanvasElement} targetCanvas", + " * @param {{x: number, y: number, width: number, height: number}} frame", + " * @param {[number, number, number]} originColor The color to replace from.", + " * @param {[number, number, number]} targetColor The color to replate to.", + " * @param {number} hueScope Pixels within the hue scope relatively from originColor are recolorized.", + " * @param {number} saturationScope Pixels within the saturation scope relatively from originColor are recolorized.", + " * @param {number} lighnessScope Pixels within the lightness scope relatively from originColor are recolorized.", + " */", + "const recolorizeTexture = function (sourceCanvas, targetCanvas, frame, originColor, targetColor, hueScope, saturationScope, lighnessScope) {", + " const sourceContext = sourceCanvas.getContext('2d');", + " const targetContext = targetCanvas.getContext('2d');", + " const sourcePixels = sourceContext.getImageData(0, 0, frame.width, frame.height).data;", + " const targetImageData = targetContext.getImageData(0, 0, frame.width, frame.height);", + " const targetPixels = targetImageData.data;", + "", + " const originColorHSL = rgbToHsl(originColor[0], originColor[1], originColor[2]);", + " const targetColorHSL = rgbToHsl(targetColor[0], targetColor[1], targetColor[2]);", + "", + " const originHue = originColorHSL[0];", + " const originSaturation = originColorHSL[1];", + " const originLightness = originColorHSL[2];", + "", + " const targetHue = targetColorHSL[0];", + " const targetSaturation = targetColorHSL[1];", + " const saturationDelta = targetSaturation - originSaturation;", + " const lightnessDelta = targetColorHSL[2] - originLightness;", + "", + " // hue is not knowned for graycase colors.", + " const hueIsConstrained = hueScope < 0.5;", + "", + " for (let i = 0; i < sourcePixels.length; i += 4) {", + " const pixelHsl = rgbToHsl(sourcePixels[i + 0], sourcePixels[i + 1], sourcePixels[i + 2]);", + "", + " const pixelHue = pixelHsl[0];", + " const pixelSaturation = pixelHsl[1];", + " const pixelLightness = pixelHsl[2];", + "", + " const hueDelta = gdjs.evtTools.common.mod(pixelHue - originHue + 0.5, 1) - 0.5;", + " if ((!hueIsConstrained || Math.abs(hueDelta) <= hueScope)", + " && Math.abs(pixelSaturation - originSaturation) <= saturationScope", + " && Math.abs(pixelLightness - originLightness) <= lighnessScope) {", + " // graycase pixels must take the targeted hue", + " pixelHsl[0] = pixelSaturation === 0 ? targetHue : gdjs.evtTools.common.mod(pixelHue - originHue + targetHue, 1);", + " // white pixels must also take the targeted saturation.", + " pixelHsl[1] = pixelLightness > 0.999 ? targetSaturation : gdjs.evtTools.common.clamp(pixelSaturation + saturationDelta, 0, 1);", + " pixelHsl[2] = gdjs.evtTools.common.clamp(pixelLightness + lightnessDelta, 0, 1);", + " const pixelRgb = hslToRgb(pixelHsl[0], pixelHsl[1], pixelHsl[2]);", + " targetPixels[i + 0] = pixelRgb[0];", + " targetPixels[i + 1] = pixelRgb[1];", + " targetPixels[i + 2] = pixelRgb[2];", + " }", + " }", + " targetContext.putImageData(targetImageData, 0, 0);", + "};", + "", + "/**", + " * @param {[number, number, number]} originColor The color to replace from.", + " * @param {[number, number, number]} targetColor The color to replate to.", + " * @param {number} hueScope Pixels within the hue scope relatively from originColor are recolorized.", + " * @param {number} saturationScope Pixels within the saturation scope relatively from originColor are recolorized.", + " * @param {number} lighnessScope Pixels within the lightness scope relatively from originColor are recolorized.", + " * @return {number} key", + " */", + "const getRecolorizationKey = function (originColor, targetColor, hueScope, saturationScope, lighnessScope) {", + " return String.fromCharCode(originColor[0] * (2 ** 8) + originColor[1],", + " originColor[2] * (2 ** 8) + targetColor[0],", + " targetColor[1] * (2 ** 8) + targetColor[2],", + " (hueScope * (2 ** 8) + saturationScope) * (2 ** 8),", + " lighnessScope * (2 ** 8));", + "}", + "", + "gdjs.__recolorizerExtension = gdjs.__recolorizerExtension || {};", + "", + "/**", + " * @param {PIXI.Texture} texture", + " * @returns {HTMLCanvasElement}", + " */", + "gdjs.__recolorizerExtension.getCanvas = function (texture) {", + " /** @type {HTMLCanvasElement} */", + " const canvas = document.createElement('canvas');", + "", + " const context = canvas.getContext('2d');", + " const crop = texture._frame.clone();", + " const resolution = texture.baseTexture.resolution;", + "", + " crop.x *= resolution;", + " crop.y *= resolution;", + " crop.width *= resolution;", + " crop.height *= resolution;", + "", + " canvas.width = Math.ceil(crop.width);", + " canvas.height = Math.ceil(crop.height);", + "", + " context.save();", + " context.globalCompositeOperation = 'copy';", + " context.drawImage(", + " texture.baseTexture.getDrawableSource(),", + " crop.x,", + " crop.y,", + " crop.width,", + " crop.height,", + " 0,", + " 0,", + " crop.width,", + " crop.height", + " );", + " context.restore();", + "", + " return canvas;", + "}", + "", + "/**", + " * Manage recolorizations to ensure uniqueness of textures.", + " **/", + "gdjs.__recolorizerExtension.RecolorizationManager = /** @class */ (function () {", + " /**", + " * Create a manager.", + " * @param {PIXI.Texture[]} sourceTextures", + " */", + " function RecolorizationManager(sourceTextures) {", + " /** @type {PIXI.Texture[]} */", + " this.sourceTextures = sourceTextures;", + " this.sourceCanvas = sourceTextures.map(texture => gdjs.__recolorizerExtension.getCanvas(texture));", + " /** @type {Map} */", + " this.recolorizedSprites = new Map();", + " /** @type {Array<{userCount: integer, textures: PIXI.Texture[], canvas: HTMLCanvasElement[]}>} */", + " this.recycledRecolorizedSprites = [];", + " }", + "", + " /**", + " * Unregister a recoloration usage.", + " *", + " * @param {string} previousRecolorizationKey", + " */", + " RecolorizationManager.prototype.unregister = function (previousRecolorizationKey) {", + " const previousRecolorizedSprite = this.recolorizedSprites.get(previousRecolorizationKey);", + " if (previousRecolorizedSprite) {", + " previousRecolorizedSprite.userCount--;", + " if (previousRecolorizedSprite.userCount <= 0) {", + " this.recolorizedSprites.delete(previousRecolorizationKey);", + " this.recycledRecolorizedSprites.push(previousRecolorizedSprite);", + " }", + " }", + " }", + "", + " /**", + " * Register a recolorization usage and get recolored textures.", + " *", + " * @param {string} recolorizationKey", + " * @param {Array<{originColor: [number, number, number], targetColor: [number, number, number], hueScope: number, saturationScope: number, lighnessScope: number}>} recolorizations", + " * @returns {PIXI.Texture[]} ", + " */", + " RecolorizationManager.prototype.register = function (recolorizationKey, recolorizations) {", + " if (recolorizationKey === \"\") {", + " return this.sourceTextures;", + " }", + "", + " /** @type {PIXI.Texture[]} */", + " let targetTextures;", + " let recolorizedSprite = this.recolorizedSprites.get(recolorizationKey);", + " if (recolorizedSprite) {", + " targetTextures = recolorizedSprite.textures;", + " }", + " else {", + " if (this.recycledRecolorizedSprites.length > 0) {", + " const reusableRecolorizedSprite = this.recycledRecolorizedSprites.pop();", + " targetTextures = reusableRecolorizedSprite.textures;", + " /** @type {PIXI.Texture[]} */", + " const targetCanvas = reusableRecolorizedSprite.canvas;", + "", + " for (let textureIndex = 0; textureIndex < this.sourceTextures.length; textureIndex++) {", + " const sourceTexture = this.sourceTextures[textureIndex];", + " const targetCanva = targetCanvas[textureIndex];", + " resetCanvas(targetCanva, sourceTexture);", + " }", + "", + " this._recolorizeAll(targetCanvas, recolorizations);", + "", + " targetTextures.forEach(texture => texture.update());", + " reusableRecolorizedSprite.userCount = 0;", + " recolorizedSprite = reusableRecolorizedSprite;", + " }", + " else {", + " /** @type {HTMLCanvasElement[]} */", + " const targetCanvas = this.sourceTextures.map(texture => gdjs.__recolorizerExtension.getCanvas(texture));", + "", + " this._recolorizeAll(targetCanvas, recolorizations);", + "", + " targetTextures = targetCanvas.map((targetCanva, index) => {", + " const texture = PIXI.Texture.from(targetCanva);", + " texture.baseTexture.scaleMode = this.sourceTextures[index].baseTexture.scaleMode;", + " texture.baseTexture.wrapMode = this.sourceTextures[index].baseTexture.wrapMode;", + " texture.baseTexture.alphaMode = this.sourceTextures[index].baseTexture.alphaMode;", + " return texture;", + " });", + " recolorizedSprite = { userCount: 0, textures: targetTextures, canvas: targetCanvas };", + " }", + " this.recolorizedSprites.set(recolorizationKey, recolorizedSprite);", + " }", + " recolorizedSprite.userCount++;", + " return targetTextures;", + " }", + "", + " /**", + " * Apply a recoloration to every textures.", + " *", + " * @param {HTMLCanvasElement[]} targetCanvas", + " * @param {Array<{originColor: [number, number, number], targetColor: [number, number, number], hueScope: number, saturationScope: number, lighnessScope: number}>} recolorizations", + " */", + " RecolorizationManager.prototype._recolorizeAll = function (targetCanvas, recolorizations) {", + " for (let textureIndex = 0; textureIndex < this.sourceTextures.length; textureIndex++) {", + " const sourceTexture = this.sourceTextures[textureIndex];", + " const targetCanva = targetCanvas[textureIndex];", + " const frame = sourceTexture._frame;", + " for (const recolorization of recolorizations) {", + " recolorizeTexture(", + " this.sourceCanvas[textureIndex],", + " targetCanva,", + " frame,", + " recolorization.originColor,", + " recolorization.targetColor,", + " recolorization.hueScope,", + " recolorization.saturationScope,", + " recolorization.lighnessScope", + " );", + " }", + " }", + " }", + "", + " return RecolorizationManager;", + "}());", + "", + "/**", + " * Object recolorizer.", + " **/", + "gdjs.__recolorizerExtension.Recolorizer = /** @class */ (function () {", + " /**", + " * Create an object recolorizer.", + " * @param {gdjs.__recolorizerExtension.RecolorizationManager} manager", + " * @param {{texture: PIXI.Texture[]}} sourceTextureConatiners", + " */", + " function Recolorizer(manager, sourceTextureContainers) {", + " this.manager = manager;", + " this.sourceTextureContainers = sourceTextureContainers;", + "", + " this.previousRecolorizationKey = \"\";", + " this.recolorizationKey = \"\";", + " /** @type {Array<{originColor: [number, number, number], targetColor: [number, number, number], hueScope: number, saturationScope: number, lighnessScope: number}>} */", + " this.recolorizations = [];", + " }", + "", + " /**", + " * Replace a color with an other one.", + " *", + " * @param {[number, number, number]} originColor The color to replace from.", + " * @param {[number, number, number]} targetColor The color to replate to.", + " * @param {number} hueScope Pixels within the hue scope relatively from originColor are recolorized.", + " * @param {number} saturationScope Pixels within the saturation scope relatively from originColor are recolorized.", + " * @param {number} lighnessScope Pixels within the lightness scope relatively from originColor are recolorized.", + " */", + " Recolorizer.prototype.recolorizeSprite = function (originColor, targetColor, hueScope, saturationScope, lighnessScope) {", + " this.recolorizationKey += getRecolorizationKey(originColor, targetColor, hueScope, saturationScope, lighnessScope);", + " this.recolorizations.push({ originColor, targetColor, hueScope, saturationScope, lighnessScope});", + " }", + "", + " /**", + " * Reset the default textures of the object.", + " */", + " Recolorizer.prototype.resetSprite = function () {", + " this.recolorizationKey = \"\";", + " this.recolorizations = [];", + " }", + "", + " /**", + " * Update the textures of the object.", + " */", + " Recolorizer.prototype.updateSprite = function () {", + " const needsRecolorization = this.recolorizationKey !== this.previousRecolorizationKey;", + " if (needsRecolorization) {", + " this.manager.unregister(this.previousRecolorizationKey);", + "", + " /** @type {PIXI.Texture[]} */", + " const targetTextures = this.manager.register(this.recolorizationKey, this.recolorizations);", + "", + " let textureIndex = 0;", + " for (const container of this.sourceTextureContainers) {", + " container.texture = targetTextures[textureIndex];", + " textureIndex++;", + " }", + " this.previousRecolorizationKey = this.recolorizationKey;", + " }", + " return needsRecolorization;", + " }", + "", + " return Recolorizer;", + "}());" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true @@ -10810,39 +11769,69 @@ "objectType": "Sprite", "eventsFunctions": [ { - "description": "", "fullName": "", "functionType": "Action", - "group": "", "name": "onCreated", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "Recolorizer::DefineJavaScript" }, "parameters": [ "", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "/** @type {gdjs.SpriteRuntimeObject} */\nconst sprite = objects[0];\nconst behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\nconst behavior = sprite.getBehavior(behaviorName);\n\nif (!runtimeScene.__recolorizerExtension) {\n runtimeScene.__recolorizerExtension = { managers: new Map()};\n}\n/** @type {Map} */\nconst managers = runtimeScene.__recolorizerExtension.managers || new Map();\nlet manager = managers.get(sprite.getName());\nif (!manager) {\n /** @type {PIXI.Texture[]} */\n const sourceTextures = [];\n for (const animation of sprite._animations) {\n for (const direction of animation.directions) {\n for (const frame of direction.frames) {\n sourceTextures.push(frame.texture);\n }\n }\n }\n manager = new gdjs.__recolorizerExtension.RecolorizationManager(sourceTextures);\n managers.set(sprite.getName(), manager);\n}\n\n/** @type {{texture: PIXI.Texture[]}} */\nconst sourceTextureContainers = [];\nfor (const animation of sprite._animations) {\n for (const direction of animation.directions) {\n for (const frame of direction.frames) {\n sourceTextureContainers.push(frame);\n }\n }\n}\n\nbehavior.recolorizer = new gdjs.__recolorizerExtension.Recolorizer(\n manager,\n sourceTextureContainers\n);", + "inlineCode": [ + "/** @type {gdjs.SpriteRuntimeObject} */", + "const sprite = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = sprite.getBehavior(behaviorName);", + "", + "if (!runtimeScene.__recolorizerExtension) {", + " runtimeScene.__recolorizerExtension = { managers: new Map()};", + "}", + "/** @type {Map} */", + "const managers = runtimeScene.__recolorizerExtension.managers || new Map();", + "let manager = managers.get(sprite.getName());", + "if (!manager) {", + " /** @type {PIXI.Texture[]} */", + " const sourceTextures = [];", + " for (const animation of sprite._animations) {", + " for (const direction of animation.directions) {", + " for (const frame of direction.frames) {", + " sourceTextures.push(frame.texture);", + " }", + " }", + " }", + " manager = new gdjs.__recolorizerExtension.RecolorizationManager(sourceTextures);", + " managers.set(sprite.getName(), manager);", + "}", + "", + "/** @type {{texture: PIXI.Texture[]}} */", + "const sourceTextureContainers = [];", + "for (const animation of sprite._animations) {", + " for (const direction of animation.directions) {", + " for (const frame of direction.frames) {", + " sourceTextureContainers.push(frame);", + " }", + " }", + "}", + "", + "behavior.recolorizer = new gdjs.__recolorizerExtension.Recolorizer(", + " manager,", + " sourceTextureContainers", + ");" + ], "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true @@ -10850,22 +11839,14 @@ ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "Sprite", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "Recolorizer::SpriteRecolorizer", "type": "behavior" } @@ -10876,16 +11857,23 @@ "description": "Replace a given color of an object with another one. The scope allows to change similar colors at once.", "fullName": "Recolorize", "functionType": "Action", - "group": "", "name": "Recolorize", - "private": false, "sentence": "Recolorize _PARAM0_ from color _PARAM2_ to color _PARAM3_ within a scope of hue: _PARAM4_° saturation: _PARAM5_% lightness: _PARAM6_%", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\nconst behavior = objects[0].getBehavior(behaviorName);\n\nconst originColor = gdjs.rgbOrHexToRGBColor(eventsFunctionContext.getArgument(\"OriginColor\"));\nconst targetColor = gdjs.rgbOrHexToRGBColor(eventsFunctionContext.getArgument(\"TargetColor\"));\nconst hueScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"HueScope\") / 360, 0, 180);\nconst saturationScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"SaturationScope\") / 100, 0, 50);\nconst lightnessScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"LightnessScope\") / 100, 0, 50);\n\nbehavior.recolorizer.recolorizeSprite(originColor, targetColor, hueScope, saturationScope, lightnessScope);", + "inlineCode": [ + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = objects[0].getBehavior(behaviorName);", + "", + "const originColor = gdjs.rgbOrHexToRGBColor(eventsFunctionContext.getArgument(\"OriginColor\"));", + "const targetColor = gdjs.rgbOrHexToRGBColor(eventsFunctionContext.getArgument(\"TargetColor\"));", + "const hueScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"HueScope\") / 360, 0, 180);", + "const saturationScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"SaturationScope\") / 100, 0, 50);", + "const lightnessScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"LightnessScope\") / 100, 0, 50);", + "", + "behavior.recolorizer.recolorizeSprite(originColor, targetColor, hueScope, saturationScope, lightnessScope);" + ], "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true @@ -10893,73 +11881,40 @@ ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "Sprite", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "Recolorizer::SpriteRecolorizer", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Origin color", - "longDescription": "", "name": "OriginColor", - "optional": false, - "supplementaryInformation": "", "type": "color" }, { - "codeOnly": false, - "defaultValue": "", "description": "Target color", - "longDescription": "", "name": "TargetColor", - "optional": false, - "supplementaryInformation": "", "type": "color" }, { - "codeOnly": false, - "defaultValue": "", "description": "Hue scope (from 0° to 180°)", - "longDescription": "", "name": "HueScope", - "optional": false, - "supplementaryInformation": "", "type": "expression" }, { - "codeOnly": false, - "defaultValue": "", "description": "Saturation scope (in percent)", - "longDescription": "", "name": "SaturationScope", - "optional": false, - "supplementaryInformation": "", "type": "expression" }, { - "codeOnly": false, - "defaultValue": "", "description": "Lightness scope (in percent)", - "longDescription": "", "name": "LightnessScope", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -10969,16 +11924,17 @@ "description": "Set back the original colors of an object.", "fullName": "Reset color", "functionType": "Action", - "group": "", "name": "ResetColor", - "private": false, "sentence": "Reset the colors of _PARAM0_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\nconst behavior = objects[0].getBehavior(behaviorName);\n\nbehavior.recolorizer.resetSprite();", + "inlineCode": [ + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = objects[0].getBehavior(behaviorName);", + "", + "behavior.recolorizer.resetSprite();" + ], "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true @@ -10986,22 +11942,14 @@ ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "Sprite", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "Recolorizer::SpriteRecolorizer", "type": "behavior" } @@ -11009,19 +11957,25 @@ "objectGroups": [] }, { - "description": "", "fullName": "", "functionType": "Action", - "group": "", "name": "doStepPostEvents", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "\r\n/** @type {gdjs.SpriteRuntimeObject} */\r\nconst sprite = objects[0];\r\nconst behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r\nconst behavior = sprite.getBehavior(behaviorName);\r\n\r\nconst recolorized = behavior.recolorizer.updateSprite();\r\nif (recolorized) {\r\n sprite._animationFrameDirty = true;\r\n}", + "inlineCode": [ + "\r", + "/** @type {gdjs.SpriteRuntimeObject} */\r", + "const sprite = objects[0];\r", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", + "const behavior = sprite.getBehavior(behaviorName);\r", + "\r", + "const recolorized = behavior.recolorizer.updateSprite();\r", + "if (recolorized) {\r", + " sprite._animationFrameDirty = true;\r", + "}" + ], "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true @@ -11029,22 +11983,14 @@ ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "Sprite", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "Recolorizer::SpriteRecolorizer", "type": "behavior" } @@ -11052,17 +11998,12 @@ "objectGroups": [] }, { - "description": "", "fullName": "", "functionType": "Action", - "group": "", "name": "onDestroy", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -11076,45 +12017,32 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "Recolorizer::SpriteRecolorizer::ResetColor" }, "parameters": [ "Object", "Behavior", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "Sprite", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "Recolorizer::SpriteRecolorizer", "type": "behavior" } @@ -11122,7 +12050,8 @@ "objectGroups": [] } ], - "propertyDescriptors": [] + "propertyDescriptors": [], + "sharedPropertyDescriptors": [] }, { "description": "Independently change the colors of a tiled sprite.", @@ -11131,39 +12060,53 @@ "objectType": "TiledSpriteObject::TiledSprite", "eventsFunctions": [ { - "description": "", "fullName": "", "functionType": "Action", - "group": "", "name": "onCreated", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "Recolorizer::DefineJavaScript" }, "parameters": [ "", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "/** @type {gdjs.TiledSpriteRuntimeObject} */\nconst tiledSprite = objects[0];\nconst behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\nconst behavior = tiledSprite.getBehavior(behaviorName);\n\nif (!runtimeScene.__recolorizerExtension) {\n runtimeScene.__recolorizerExtension = { managers: new Map()};\n}\n/** @type {Map} */\nconst managers = runtimeScene.__recolorizerExtension.managers || new Map();\nlet manager = managers.get(tiledSprite.getName());\nif (!manager) {\n /** @type {PIXI.TilingSprite} */\n const tilingSprite = tiledSprite.getRendererObject();\n manager = new gdjs.__recolorizerExtension.RecolorizationManager([tilingSprite.texture]);\n managers.set(tiledSprite.getName(), manager);\n}\n\nbehavior.recolorizer = new gdjs.__recolorizerExtension.Recolorizer(\n manager,\n [tiledSprite.getRendererObject()]\n);\n", + "inlineCode": [ + "/** @type {gdjs.TiledSpriteRuntimeObject} */", + "const tiledSprite = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = tiledSprite.getBehavior(behaviorName);", + "", + "if (!runtimeScene.__recolorizerExtension) {", + " runtimeScene.__recolorizerExtension = { managers: new Map()};", + "}", + "/** @type {Map} */", + "const managers = runtimeScene.__recolorizerExtension.managers || new Map();", + "let manager = managers.get(tiledSprite.getName());", + "if (!manager) {", + " /** @type {PIXI.TilingSprite} */", + " const tilingSprite = tiledSprite.getRendererObject();", + " manager = new gdjs.__recolorizerExtension.RecolorizationManager([tilingSprite.texture]);", + " managers.set(tiledSprite.getName(), manager);", + "}", + "", + "behavior.recolorizer = new gdjs.__recolorizerExtension.Recolorizer(", + " manager,", + " [tiledSprite.getRendererObject()]", + ");", + "" + ], "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true @@ -11171,22 +12114,14 @@ ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "TiledSpriteObject::TiledSprite", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "Recolorizer::TiledSpriteRecolorizer", "type": "behavior" } @@ -11197,16 +12132,23 @@ "description": "Replace a given color of an object with another one. The scope allows to change similar colors at once.", "fullName": "Recolorize", "functionType": "Action", - "group": "", "name": "Recolorize", - "private": false, "sentence": "Recolorize _PARAM0_ from color _PARAM2_ to color _PARAM3_ within a scope of hue: _PARAM4_° saturation: _PARAM5_% lightness: _PARAM6_%", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\nconst behavior = objects[0].getBehavior(behaviorName);\n\nconst originColor = gdjs.rgbOrHexToRGBColor(eventsFunctionContext.getArgument(\"OriginColor\"));\nconst targetColor = gdjs.rgbOrHexToRGBColor(eventsFunctionContext.getArgument(\"TargetColor\"));\nconst hueScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"HueScope\") / 360, 0, 180);\nconst saturationScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"SaturationScope\") / 100, 0, 50);\nconst lightnessScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"LightnessScope\") / 100, 0, 50);\n\nbehavior.recolorizer.recolorizeSprite(originColor, targetColor, hueScope, saturationScope, lightnessScope);", + "inlineCode": [ + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = objects[0].getBehavior(behaviorName);", + "", + "const originColor = gdjs.rgbOrHexToRGBColor(eventsFunctionContext.getArgument(\"OriginColor\"));", + "const targetColor = gdjs.rgbOrHexToRGBColor(eventsFunctionContext.getArgument(\"TargetColor\"));", + "const hueScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"HueScope\") / 360, 0, 180);", + "const saturationScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"SaturationScope\") / 100, 0, 50);", + "const lightnessScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"LightnessScope\") / 100, 0, 50);", + "", + "behavior.recolorizer.recolorizeSprite(originColor, targetColor, hueScope, saturationScope, lightnessScope);" + ], "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true @@ -11214,73 +12156,40 @@ ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "TiledSpriteObject::TiledSprite", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "Recolorizer::TiledSpriteRecolorizer", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Origin color", - "longDescription": "", "name": "OriginColor", - "optional": false, - "supplementaryInformation": "", "type": "color" }, { - "codeOnly": false, - "defaultValue": "", "description": "Target color", - "longDescription": "", "name": "TargetColor", - "optional": false, - "supplementaryInformation": "", "type": "color" }, { - "codeOnly": false, - "defaultValue": "", "description": "Hue scope (from 0° to 180°)", - "longDescription": "", "name": "HueScope", - "optional": false, - "supplementaryInformation": "", "type": "expression" }, { - "codeOnly": false, - "defaultValue": "", "description": "Saturation scope (in percent)", - "longDescription": "", "name": "SaturationScope", - "optional": false, - "supplementaryInformation": "", "type": "expression" }, { - "codeOnly": false, - "defaultValue": "", "description": "Lightness scope (in percent)", - "longDescription": "", "name": "LightnessScope", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -11290,16 +12199,17 @@ "description": "Set back the original colors of an object.", "fullName": "Reset color", "functionType": "Action", - "group": "", "name": "ResetColor", - "private": false, "sentence": "Reset the colors of _PARAM0_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\nconst behavior = objects[0].getBehavior(behaviorName);\n\nbehavior.recolorizer.resetSprite();", + "inlineCode": [ + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = objects[0].getBehavior(behaviorName);", + "", + "behavior.recolorizer.resetSprite();" + ], "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true @@ -11307,22 +12217,14 @@ ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "TiledSpriteObject::TiledSprite", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "Recolorizer::TiledSpriteRecolorizer", "type": "behavior" } @@ -11330,19 +12232,21 @@ "objectGroups": [] }, { - "description": "", "fullName": "", "functionType": "Action", - "group": "", "name": "doStepPostEvents", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "\r\nconst object = objects[0];\r\nconst behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r\nconst behavior = object.getBehavior(behaviorName);\r\n\r\nconst recolorized = behavior.recolorizer.updateSprite();", + "inlineCode": [ + "\r", + "const object = objects[0];\r", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", + "const behavior = object.getBehavior(behaviorName);\r", + "\r", + "const recolorized = behavior.recolorizer.updateSprite();" + ], "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true @@ -11350,22 +12254,14 @@ ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "TiledSpriteObject::TiledSprite", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "Recolorizer::TiledSpriteRecolorizer", "type": "behavior" } @@ -11373,17 +12269,12 @@ "objectGroups": [] }, { - "description": "", "fullName": "", "functionType": "Action", - "group": "", "name": "onDestroy", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -11397,45 +12288,32 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "Recolorizer::TiledSpriteRecolorizer::ResetColor" }, "parameters": [ "Object", "Behavior", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "TiledSpriteObject::TiledSprite", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "Recolorizer::TiledSpriteRecolorizer", "type": "behavior" } @@ -11443,7 +12321,8 @@ "objectGroups": [] } ], - "propertyDescriptors": [] + "propertyDescriptors": [], + "sharedPropertyDescriptors": [] }, { "description": "Independently change the colors of a panel sprite.", @@ -11452,39 +12331,57 @@ "objectType": "PanelSpriteObject::PanelSprite", "eventsFunctions": [ { - "description": "", "fullName": "", "functionType": "Action", - "group": "", "name": "onCreated", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "Recolorizer::DefineJavaScript" }, "parameters": [ "", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "/** @type {gdjs.PanelSpriteRuntimeObject} */\nconst panelSprite = objects[0];\nconst behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\nconst behavior = panelSprite.getBehavior(behaviorName);\n\nif (!runtimeScene.__recolorizerExtension) {\n runtimeScene.__recolorizerExtension = { managers: new Map()};\n}\n/** @type {Map} */\nconst managers = runtimeScene.__recolorizerExtension.managers || new Map();\nlet manager = managers.get(panelSprite.getName());\nif (!manager) {\n const renderer = panelSprite._renderer;\n /** @type {PIXI.Texture[]} */\n const sourceTextures = renderer._borderSprites.map(sprite => sprite.texture);\n sourceTextures.push(renderer._centerSprite.texture);\n manager = new gdjs.__recolorizerExtension.RecolorizationManager(sourceTextures);\n managers.set(panelSprite.getName(), manager);\n}\n\nconst renderer = panelSprite._renderer;\n\nbehavior.recolorizer = new gdjs.__recolorizerExtension.Recolorizer(\n manager,\n [...renderer._borderSprites, renderer._centerSprite],\n);\n", + "inlineCode": [ + "/** @type {gdjs.PanelSpriteRuntimeObject} */", + "const panelSprite = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = panelSprite.getBehavior(behaviorName);", + "", + "if (!runtimeScene.__recolorizerExtension) {", + " runtimeScene.__recolorizerExtension = { managers: new Map()};", + "}", + "/** @type {Map} */", + "const managers = runtimeScene.__recolorizerExtension.managers || new Map();", + "let manager = managers.get(panelSprite.getName());", + "if (!manager) {", + " const renderer = panelSprite._renderer;", + " /** @type {PIXI.Texture[]} */", + " const sourceTextures = renderer._borderSprites.map(sprite => sprite.texture);", + " sourceTextures.push(renderer._centerSprite.texture);", + " manager = new gdjs.__recolorizerExtension.RecolorizationManager(sourceTextures);", + " managers.set(panelSprite.getName(), manager);", + "}", + "", + "const renderer = panelSprite._renderer;", + "", + "behavior.recolorizer = new gdjs.__recolorizerExtension.Recolorizer(", + " manager,", + " [...renderer._borderSprites, renderer._centerSprite],", + ");", + "" + ], "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true @@ -11492,22 +12389,14 @@ ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PanelSpriteObject::PanelSprite", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "Recolorizer::PanelSpriteRecolorizer", "type": "behavior" } @@ -11518,16 +12407,23 @@ "description": "Replace a given color of an object with another one. The scope allows to change similar colors at once.", "fullName": "Recolorize", "functionType": "Action", - "group": "", "name": "Recolorize", - "private": false, "sentence": "Recolorize _PARAM0_ from color _PARAM2_ to color _PARAM3_ within a scope of hue: _PARAM4_° saturation: _PARAM5_% lightness: _PARAM6_%", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\nconst behavior = objects[0].getBehavior(behaviorName);\n\nconst originColor = gdjs.rgbOrHexToRGBColor(eventsFunctionContext.getArgument(\"OriginColor\"));\nconst targetColor = gdjs.rgbOrHexToRGBColor(eventsFunctionContext.getArgument(\"TargetColor\"));\nconst hueScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"HueScope\") / 360, 0, 180);\nconst saturationScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"SaturationScope\") / 100, 0, 50);\nconst lightnessScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"LightnessScope\") / 100, 0, 50);\n\nbehavior.recolorizer.recolorizeSprite(originColor, targetColor, hueScope, saturationScope, lightnessScope);", + "inlineCode": [ + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = objects[0].getBehavior(behaviorName);", + "", + "const originColor = gdjs.rgbOrHexToRGBColor(eventsFunctionContext.getArgument(\"OriginColor\"));", + "const targetColor = gdjs.rgbOrHexToRGBColor(eventsFunctionContext.getArgument(\"TargetColor\"));", + "const hueScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"HueScope\") / 360, 0, 180);", + "const saturationScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"SaturationScope\") / 100, 0, 50);", + "const lightnessScope = gdjs.evtTools.common.clamp(eventsFunctionContext.getArgument(\"LightnessScope\") / 100, 0, 50);", + "", + "behavior.recolorizer.recolorizeSprite(originColor, targetColor, hueScope, saturationScope, lightnessScope);" + ], "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true @@ -11535,73 +12431,40 @@ ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PanelSpriteObject::PanelSprite", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "Recolorizer::PanelSpriteRecolorizer", "type": "behavior" }, { - "codeOnly": false, - "defaultValue": "", "description": "Origin color", - "longDescription": "", "name": "OriginColor", - "optional": false, - "supplementaryInformation": "", "type": "color" }, { - "codeOnly": false, - "defaultValue": "", "description": "Target color", - "longDescription": "", "name": "TargetColor", - "optional": false, - "supplementaryInformation": "", "type": "color" }, { - "codeOnly": false, - "defaultValue": "", "description": "Hue scope (from 0° to 180°)", - "longDescription": "", "name": "HueScope", - "optional": false, - "supplementaryInformation": "", "type": "expression" }, { - "codeOnly": false, - "defaultValue": "", "description": "Saturation scope (in percent)", - "longDescription": "", "name": "SaturationScope", - "optional": false, - "supplementaryInformation": "", "type": "expression" }, { - "codeOnly": false, - "defaultValue": "", "description": "Lightness scope (in percent)", - "longDescription": "", "name": "LightnessScope", - "optional": false, - "supplementaryInformation": "", "type": "expression" } ], @@ -11611,16 +12474,17 @@ "description": "Set back the original colors of an object.", "fullName": "Reset color", "functionType": "Action", - "group": "", "name": "ResetColor", - "private": false, "sentence": "Reset the colors of _PARAM0_", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\nconst behavior = objects[0].getBehavior(behaviorName);\n\nbehavior.recolorizer.resetSprite();", + "inlineCode": [ + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = objects[0].getBehavior(behaviorName);", + "", + "behavior.recolorizer.resetSprite();" + ], "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true @@ -11628,22 +12492,14 @@ ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PanelSpriteObject::PanelSprite", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "Recolorizer::PanelSpriteRecolorizer", "type": "behavior" } @@ -11651,19 +12507,26 @@ "objectGroups": [] }, { - "description": "", "fullName": "", "functionType": "Action", - "group": "", "name": "doStepPostEvents", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "/** @type {gdjs.PanelSpriteRuntimeObject} */\r\nconst panelSprite = objects[0];\r\nconst behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r\nconst behavior = panelSprite.getBehavior(behaviorName);\r\n\r\nconst recolorized = behavior.recolorizer.updateSprite();\r\nif (recolorized) {\r\n const renderer = panelSprite._renderer;\r\n //renderer._wasRendered = false;\r\n renderer._spritesContainer.cacheAsBitmap = false;\r\n}", + "inlineCode": [ + "/** @type {gdjs.PanelSpriteRuntimeObject} */\r", + "const panelSprite = objects[0];\r", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", + "const behavior = panelSprite.getBehavior(behaviorName);\r", + "\r", + "const recolorized = behavior.recolorizer.updateSprite();\r", + "if (recolorized) {\r", + " const renderer = panelSprite._renderer;\r", + " //renderer._wasRendered = false;\r", + " renderer._spritesContainer.cacheAsBitmap = false;\r", + "}" + ], "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true @@ -11671,22 +12534,14 @@ ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PanelSpriteObject::PanelSprite", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "Recolorizer::PanelSpriteRecolorizer", "type": "behavior" } @@ -11694,17 +12549,12 @@ "objectGroups": [] }, { - "description": "", "fullName": "", "functionType": "Action", - "group": "", "name": "onDestroy", - "private": false, "sentence": "", "events": [ { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Comment", "color": { "b": 109, @@ -11718,45 +12568,32 @@ "comment2": "" }, { - "disabled": false, - "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "inverted": false, "value": "Recolorizer::TiledSpriteRecolorizer::ResetColor" }, "parameters": [ "Object", "Behavior", "" - ], - "subInstructions": [] + ] } - ], - "events": [] + ] } ], "parameters": [ { - "codeOnly": false, - "defaultValue": "", "description": "Object", - "longDescription": "", "name": "Object", - "optional": false, "supplementaryInformation": "PanelSpriteObject::PanelSprite", "type": "object" }, { - "codeOnly": false, - "defaultValue": "", "description": "Behavior", - "longDescription": "", "name": "Behavior", - "optional": false, "supplementaryInformation": "Recolorizer::PanelSpriteRecolorizer", "type": "behavior" } @@ -11764,9 +12601,11 @@ "objectGroups": [] } ], - "propertyDescriptors": [] + "propertyDescriptors": [], + "sharedPropertyDescriptors": [] } - ] + ], + "eventsBasedObjects": [] } ], "externalLayouts": [],