From d5ade2c1cdde7970857c03e35e7aa83f5d57c7b9 Mon Sep 17 00:00:00 2001 From: HelperWesley <72082749+HelperWesley@users.noreply.github.com> Date: Wed, 4 Mar 2026 00:53:12 -0330 Subject: [PATCH 1/2] Adding Variants for the scroll bar object. Added variants of the object to the game. I did not find a good solution for the 1-bit variant, because it doesn't stop at the end of the background when the overall length of the scroll bar is too short. The problem goes away when you stretch the scroll bar and make it longer. --- .../assets/BlackRoundedSquareBackground.png | Bin 0 -> 248 bytes .../assets/BlackSquarePixelBackground.png | Bin 0 -> 154 bytes .../assets/BlackTinySwordsPixelBackground.png | Bin 0 -> 237 bytes .../assets/BlueRoundedSquareThumb.png | Bin 0 -> 368 bytes .../assets/BlueTinySwordsPixelThumb.png | Bin 0 -> 698 bytes .../assets/GreenRoundedSquareThumb.png | Bin 0 -> 372 bytes .../assets/GreyRoundedSquareThumb.png | Bin 0 -> 356 bytes .../assets/RedRoundedSquareThumb.png | Bin 0 -> 347 bytes .../assets/RedTinySwordsPixelThumb.png | Bin 0 -> 701 bytes .../assets/SquareWhiteBackground.png | Bin 0 -> 154 bytes .../assets/SquareWhiteThumb.png | Bin 0 -> 166 bytes .../assets/White1BitSquareThumb.png | Bin 0 -> 119 bytes .../assets/WhiteFantasyPixelThumb.png | Bin 0 -> 282 bytes .../assets/YellowRoundedSquareThumb.png | Bin 0 -> 351 bytes .../variants-scrollbar.json | 3222 +++++++++++++++++ 15 files changed, 3222 insertions(+) create mode 100644 examples/variants-scrollbar/assets/BlackRoundedSquareBackground.png create mode 100644 examples/variants-scrollbar/assets/BlackSquarePixelBackground.png create mode 100644 examples/variants-scrollbar/assets/BlackTinySwordsPixelBackground.png create mode 100644 examples/variants-scrollbar/assets/BlueRoundedSquareThumb.png create mode 100644 examples/variants-scrollbar/assets/BlueTinySwordsPixelThumb.png create mode 100644 examples/variants-scrollbar/assets/GreenRoundedSquareThumb.png create mode 100644 examples/variants-scrollbar/assets/GreyRoundedSquareThumb.png create mode 100644 examples/variants-scrollbar/assets/RedRoundedSquareThumb.png create mode 100644 examples/variants-scrollbar/assets/RedTinySwordsPixelThumb.png create mode 100644 examples/variants-scrollbar/assets/SquareWhiteBackground.png create mode 100644 examples/variants-scrollbar/assets/SquareWhiteThumb.png create mode 100644 examples/variants-scrollbar/assets/White1BitSquareThumb.png create mode 100644 examples/variants-scrollbar/assets/WhiteFantasyPixelThumb.png create mode 100644 examples/variants-scrollbar/assets/YellowRoundedSquareThumb.png create mode 100644 examples/variants-scrollbar/variants-scrollbar.json diff --git a/examples/variants-scrollbar/assets/BlackRoundedSquareBackground.png b/examples/variants-scrollbar/assets/BlackRoundedSquareBackground.png new file mode 100644 index 0000000000000000000000000000000000000000..b0000758bfb949ec86a8a606c4b422c39a4f5e5b GIT binary patch literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4&HECyrsn$JLrv%n*= zn1Ml08H5=tmfDvA1=&kHeO=jKG4TrU>VN$4b1qOwvcxr_#5q4VH#M(>!MP|ku_QG` zp**uBL&4qCHz2%`PaLQy!PCVt#N+teYl?gg20U&Lw;$qj*r1TM<9{Is)8@!GCQU_5 zD}KjsDp@r@_faNe*#Gl2uRldLPHQ+D@6yiLx}%HHQs9JJ0TT;{fP%vT?k@-a-fa-$ l*mCfEkKl~DxH_iayd^o@eA4rRKLG7w@O1TaS?83{1OQl6Q7!-g literal 0 HcmV?d00001 diff --git a/examples/variants-scrollbar/assets/BlackSquarePixelBackground.png b/examples/variants-scrollbar/assets/BlackSquarePixelBackground.png new file mode 100644 index 0000000000000000000000000000000000000000..967ff9466feaf46d1fe592c9e8a0dbc57694e760 GIT binary patch literal 154 zcmeAS@N?(olHy`uVBq!ia0vp^Od!m`1|*BN@u~nR&H|6fVg?31We{epSZZGe6l5>) z^mS!_#l$Pb&(u0qm<1>#S>hT|;+&tGo0?a`;9QiNSdyBeP@Y+mq2TW68xY>eCk|93 r;_2cT!f`!0B_W|8Jpl-k8kiVZBpAFK{}}TE3VR6wDYhhUcNd2LAh=-f^2tCE&H|6f zVg?3oVGw3ym^DWND9B#o>Fdh=iiuZHRKG}(`!i5Tvcxr_#5q4VH#M(>!MP|ku_QG` zp**uBL&4qCHz2%`PaLQy)YHW=B;xSf8-`*B6gXHe9^74-r9b`L^3JsZDcctR%Hcd{ zKG$0EwE*XX!bT4_^?Mp#B3oD&tl78$8GQI@_wT-Y!;@=|dGE(1RGZs=XJqUDrKx2A Pw1C0W)z4*}Q$iB}5GGI| literal 0 HcmV?d00001 diff --git a/examples/variants-scrollbar/assets/BlueRoundedSquareThumb.png b/examples/variants-scrollbar/assets/BlueRoundedSquareThumb.png new file mode 100644 index 0000000000000000000000000000000000000000..1c98f175008f5ec39b7099ce4066e415db869203 GIT binary patch literal 368 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4&HECyrsn$JLrv%n*= zn1Ml08H5=tmfDvA1=&kHeO=jKG4TqB@_Y0;@&JV-OI#yLobz*YQ}ap~oQqNuOHxx5 z$}>wc6x=<11Hv2m#DR)#c)B=-cpQH_b)(ne01=1tYxy;o9%!smj^@}m@mta%g zH{nfQ+-EPmt8*FzVP2H?V_#} z^ME1r+KMGtKfQ`$+nm#vamX&fv#0AAlT5$AHLrQK==(+O~Ldd~vt!V`jStAf#vT|L=1>GY!Uj^X2Dymd7l0 zRCP63**$01iCFo+Umko;-1>4(d{m?H^1L0Z#jbC+w@I_I@J{Uk1sH>;tDnm{r-UW| Dj%|qE literal 0 HcmV?d00001 diff --git a/examples/variants-scrollbar/assets/BlueTinySwordsPixelThumb.png b/examples/variants-scrollbar/assets/BlueTinySwordsPixelThumb.png new file mode 100644 index 0000000000000000000000000000000000000000..77b7c2e5ddea13ea4642907e29a798161eb30a59 GIT binary patch literal 698 zcmV;r0!96aP)H-ZB5i02y>e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00JUOL_t(o!`+x6Oan0#hF_N< zW=Xb85Xi(5hQKX^;81gDa99$=%)|-A#02KVl3CoQaZ@-#$lL@YnYchEE=PhrK>`TU z%j>(guLTBymn_+>?fc&U+O_X0fLLX1`wf<0$zm$-vsgCJ6o4>6C*v^tzP`ET<^1vf z4gdh=vnM!e_q6aF7z44n!X;GNeD(wYpahUCrb4(tUEmbR!Hb*%-5{Ikg0DBqnV)QN zNyT)4FOUm>`YZaXJnfxnLH(esJU3fy>(m)jO`#ZAs#TS?G>Wr!8~}#XbQer&bWwlC!$3J6r9-*-Q@9RjQmfQlvJ;+T zQ(f$0I)C_lR?6F9800$o7JVilEehE3RyvrBL$;{5)z;R<#i_D6=Ag6$5~i0m*S88^ zU=F;yzXLZ{w`>3=M=t#^LjmXJVdGOK{Q0(bCRiU8=FI zR#vPZn^E5du7fUJoY65lLE0MuI^S}xrD~l$Coj(6WHA-q6$l2{e&dY2e39z0YL_&d g){Aoa@*CGp?<(ahHUnbmasU7T07*qoM6N<$g2B8nZ2$lO literal 0 HcmV?d00001 diff --git a/examples/variants-scrollbar/assets/GreenRoundedSquareThumb.png b/examples/variants-scrollbar/assets/GreenRoundedSquareThumb.png new file mode 100644 index 0000000000000000000000000000000000000000..36e83eeecea06b683d51966100dadc830d0bc5af GIT binary patch literal 372 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4&HECyrsn$JLrv%n*= zn1Ml08H5=tmfDvA1=&kHeO=jKG4TqpF#dVtFAWruEOCt}an8@pP0cG|a4t$sEJ;mK zD9E;7SDtlg`ghWBZFB9dyM6&r%03@^{+qotGSS#mC6!_C zLj?<&1$W@9vAGb{)DQ(nW53q1VR~2U-nna?P)wKld!iUSLciR z>9l!XdJdJbVOLVGzW6e!+tz-c&FeoV&Q{sq7Jhhp{p*`&(h_@ZOfUWXw+`q}22WQ% Jmvv4FO#qm&kqiI; literal 0 HcmV?d00001 diff --git a/examples/variants-scrollbar/assets/GreyRoundedSquareThumb.png b/examples/variants-scrollbar/assets/GreyRoundedSquareThumb.png new file mode 100644 index 0000000000000000000000000000000000000000..54c2f510b95ef064000273f93a328100e396bd7c GIT binary patch literal 356 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4&HECyrsn$JLrv%n*= zn1Ml08H5=tmfDvA1=&kHeO=jKG4TqpGS&Rke*hGcEOCt}an8@pP0cG|a4t$sEJ;mK zD9C*!-8=y zqlc8wPKFr9>seZyo}tYQ2RX$Y6&Ra;9Q|83JLg`?Svy9LNp~Y$)odgajxjofT-K1v zRlWH}eASUZjDktwQzaeti$B^b^mw8X)rB7u^@jmB2e9PigS!mz_puZSAUHx3vIVCg!09v$s9RL6T literal 0 HcmV?d00001 diff --git a/examples/variants-scrollbar/assets/RedRoundedSquareThumb.png b/examples/variants-scrollbar/assets/RedRoundedSquareThumb.png new file mode 100644 index 0000000000000000000000000000000000000000..11f84633ede8c61efe9cc40ae714d5221a1ce8ea GIT binary patch literal 347 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4&HECyrsn$JLrv%n*= zn1Ml08H5=tmfDvA1=&kHeO=jKG4Tqp30}^%{Rvni*f-| z-T}cKoo?G_dx&_5aETrjx~VarjkEXB+p_oT(6Vz?`@B>XHD>;GlVepX>I0=*XXQO}ZhQuYhq%ym1@zlqv0> zvfp1j`=9T~>I)tLFU$7*l94>lwdMc_UGn&M-`4!T!)xUOmGvIHzY;TR&-{DI?BbWq iW#lu{E?fQfMPZ}8hHr25+^Ye4hr!d;&t;ucLK6VlL4D@{ literal 0 HcmV?d00001 diff --git a/examples/variants-scrollbar/assets/RedTinySwordsPixelThumb.png b/examples/variants-scrollbar/assets/RedTinySwordsPixelThumb.png new file mode 100644 index 0000000000000000000000000000000000000000..be9c71ecd4df505dae6732750ca9f0baa2b765ab GIT binary patch literal 701 zcmV;u0z&H-ZB8a9#Azx)6I02y>e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00JdRL_t(o!`+xMPr^VH$6uQp z37fF68A%*)zz`W29EqWPky}s+a zGZ2GsqP@HKd;izR_4OQ3tW-JshCNsqEF668>>H>Hz|le9n$_g@(bcJy^UZ7t000wF zfZLZ35}pBLAU0FDgi4!;0sufNfG}7%jtSHRt^zr@;1r}5%~z~qDtIs6CVrCQl8V&@ zRFpQx`4gt8kv8geNYLPMn!0YxSGkW)n`#w`fwf|s8uKHOjNTuryDQ%gZ>#W(|1 z1JPwfHJ4L6?zgo-6)xvsctcZ=?yh&Hya2s;s|Vx3alid*IG6IBD>k*gfw`Lae~J$W zOl=^h=0^hjNE~pgO{2$ixoXaUsT2<$r-{S7AXKOy3FzKE*(t_5m#K1-z1%3(!&aSq z&vF6C;=*gNFYDqmfy?`9Ltxbic<~mXRZqPhrNdFLL&7PbPHn2^l9TW=*7e0EM)||< z=Tv(;Y}GRpZJRzFP;Cm>KdN-#HLGk>znLuo2q0TroT|L0J#UO^fgIh(n(0@CEiePV zyf}yF*LOAmog(ki8L zuCpLqYsXaIt}YeQsC03ruAyp&JP}Y;%V(XZ8mr~NVX$zlI}j?Jc`4TJ)!gBWRF74g jq?t-@=J4e&j+=e}*)k;znwJ)r00000NkvXXu0mjffZQ(I literal 0 HcmV?d00001 diff --git a/examples/variants-scrollbar/assets/SquareWhiteBackground.png b/examples/variants-scrollbar/assets/SquareWhiteBackground.png new file mode 100644 index 0000000000000000000000000000000000000000..f87fd058a7bab52c8f5740d659bc560f22b3a1ea GIT binary patch literal 154 zcmeAS@N?(olHy`uVBq!ia0vp^Od!m`1|*BN@u~nR&H|6fVg?3oVGw3ym^DWND9B#o z>Fdh=ib;@BLHfII*>a$eWQl7;iF1B#Zfaf$gL6@8Vo7R>LV0FMhJw4NZ$Nk>pEyvF sh^LEV2*>s0DFT6O(-MFnsey@s`!mCZg^$J00Oc7xUHx3vIVCg!07Xe9vH$=8 literal 0 HcmV?d00001 diff --git a/examples/variants-scrollbar/assets/SquareWhiteThumb.png b/examples/variants-scrollbar/assets/SquareWhiteThumb.png new file mode 100644 index 0000000000000000000000000000000000000000..01df6f4eec564ce8f6da41b14b15712d2b4ef1a8 GIT binary patch literal 166 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k&H|6fVg?3oVGw3ym^DWND9B#o z>Fdh=ib;@BO~C9Z$4a1(WQl7;iF1B#Zfaf$gL6@8Vo7R>LV0FMhJw4NZ$Nk>pEyvF zf~SjPh{pNkKmY&#uV)it5N7U72s!-V!T}A%MP9dOurX}Az?y95*O&}c%i!ti=d#Wz Gp$P!Fk1S>Y literal 0 HcmV?d00001 diff --git a/examples/variants-scrollbar/assets/White1BitSquareThumb.png b/examples/variants-scrollbar/assets/White1BitSquareThumb.png new file mode 100644 index 0000000000000000000000000000000000000000..393604c4387e5b3efa9b1860ef0bb66e9004236b GIT binary patch literal 119 zcmeAS@N?(olHy`uVBq!ia0vp^Od!kwBL7~QRScv!3p^r$G`BDaGcwGYBLNg-FY)ws zWq-xQE5xUK;kl7CP)N+v#W95Adh(zD|LvKXnT3HE2pCk@m>KuVJ>CUW!QkoY=d#Wz Gp$Pyflowc6x=<11Hv2m#DR*MJY5_^JdVE&bL2Xpz~im@|9??=q~jL9oUcZ2JT=wKoEEKE z#njNzv37H4^2O}51Gl}4Saw+Xb|+VdPwR+TY$*0zY5 z{y-?E$zGr!CFG_}f%=8*Ms3$sZ}F-BExP6>CT*$}*vrVUre0M2(EOVl=3iyLQWj%% TeY&Oy&@~L6u6{1-oD!MhT|;+&tGo0?a`;9QiNSdyBe zP@Y+mq2TW68xY>eCk|9}+|$J|#N+teskVHKfg*0_r*^s|AJZ0fTDF0!llMmBf(;B| z2lyfy4&CR=aYz#FN?a7sH{Wg1PN|6n5t(l|e=?0xx0ZyO2uKOaEB{*rnQ0}a_cV6W;?~1tM4i<*Gt%L|oaNze%i?45arrx|hL;0~qqc8|LN`3ryxA-^PD#HW1_m;B#-4OEl&3rqD mEhfT(Y?+5bXSU5v`N7oTX!d4ZrfD9~OAMZ_elF{r5}E+ne10bY literal 0 HcmV?d00001 diff --git a/examples/variants-scrollbar/variants-scrollbar.json b/examples/variants-scrollbar/variants-scrollbar.json new file mode 100644 index 000000000..745bfe117 --- /dev/null +++ b/examples/variants-scrollbar/variants-scrollbar.json @@ -0,0 +1,3222 @@ +{ + "firstLayout": "", + "gdVersion": { + "build": 259, + "major": 5, + "minor": 6, + "revision": 0 + }, + "properties": { + "adaptGameResolutionAtRuntime": true, + "antialiasingMode": "MSAA", + "antialisingEnabledOnMobile": false, + "folderProject": false, + "orientation": "landscape", + "packageName": "com.example.gamename", + "pixelsRounding": false, + "projectUuid": "f3833b0a-86a6-475e-ae8d-b912bfbee813", + "scaleMode": "linear", + "sizeOnStartupMode": "adaptWidth", + "templateSlug": "", + "version": "1.0.0", + "name": "variants-scrollbar", + "description": "", + "author": "", + "windowWidth": 1280, + "windowHeight": 720, + "latestCompilationDirectory": "", + "maxFPS": 60, + "minFPS": 20, + "verticalSync": false, + "platformSpecificAssets": {}, + "loadingScreen": { + "backgroundColor": 0, + "backgroundFadeInDuration": 0.2, + "backgroundImageResourceName": "", + "gdevelopLogoStyle": "light", + "logoAndProgressFadeInDuration": 0.2, + "logoAndProgressLogoFadeInDelay": 0, + "minDuration": 1.5, + "progressBarColor": 16777215, + "progressBarHeight": 20, + "progressBarMaxWidth": 200, + "progressBarMinWidth": 40, + "progressBarWidthPercent": 30, + "showGDevelopSplash": true, + "showProgressBar": true + }, + "watermark": { + "placement": "bottom-left", + "showWatermark": true + }, + "authorIds": [], + "authorUsernames": [], + "categories": [], + "playableDevices": [ + "mobile", + "mobile" + ], + "extensionProperties": [], + "platforms": [ + { + "name": "GDevelop JS platform" + } + ], + "currentPlatform": "GDevelop JS platform" + }, + "resources": { + "resources": [ + { + "file": "assets/BlueRoundedSquareThumb.png", + "kind": "image", + "metadata": "", + "name": "assets\\BlueRoundedSquareThumb.png", + "smoothed": true, + "userAdded": false + }, + { + "file": "assets/BlackRoundedSquareBackground.png", + "kind": "image", + "metadata": "", + "name": "assets\\BlackRoundedSquareBackground.png", + "smoothed": true, + "userAdded": false + }, + { + "file": "assets/GreenRoundedSquareThumb.png", + "kind": "image", + "metadata": "", + "name": "assets\\GreenRoundedSquareThumb.png", + "smoothed": true, + "userAdded": false + }, + { + "file": "assets/GreyRoundedSquareThumb.png", + "kind": "image", + "metadata": "", + "name": "assets\\GreyRoundedSquareThumb.png", + "smoothed": true, + "userAdded": false + }, + { + "file": "assets/RedRoundedSquareThumb.png", + "kind": "image", + "metadata": "", + "name": "assets\\RedRoundedSquareThumb.png", + "smoothed": true, + "userAdded": false + }, + { + "file": "assets/YellowRoundedSquareThumb.png", + "kind": "image", + "metadata": "", + "name": "assets\\YellowRoundedSquareThumb.png", + "smoothed": true, + "userAdded": false + }, + { + "file": "assets/WhiteFantasyPixelThumb.png", + "kind": "image", + "metadata": "", + "name": "assets\\WhiteFantasyPixelThumb.png", + "smoothed": false, + "userAdded": false + }, + { + "file": "assets/BlackSquarePixelBackground.png", + "kind": "image", + "metadata": "", + "name": "assets\\BlackSquarePixelBackground.png", + "smoothed": false, + "userAdded": false + }, + { + "file": "assets/BlueTinySwordsPixelThumb.png", + "kind": "image", + "metadata": "", + "name": "assets\\BlueTinySwordsPixelThumb.png", + "smoothed": false, + "userAdded": false + }, + { + "file": "assets/BlackTinySwordsPixelBackground.png", + "kind": "image", + "metadata": "", + "name": "assets\\BlackTinySwordsPixelBackground.png", + "smoothed": false, + "userAdded": false + }, + { + "file": "assets/RedTinySwordsPixelThumb.png", + "kind": "image", + "metadata": "", + "name": "assets\\RedTinySwordsPixelThumb.png", + "smoothed": false, + "userAdded": false + }, + { + "file": "assets/White1BitSquareThumb.png", + "kind": "image", + "metadata": "", + "name": "assets\\White1BitSquareThumb.png", + "smoothed": false, + "userAdded": false + }, + { + "file": "assets/SquareWhiteThumb.png", + "kind": "image", + "metadata": "", + "name": "assets\\SquareWhiteThumb.png", + "smoothed": false, + "userAdded": false + }, + { + "file": "assets/SquareWhiteBackground.png", + "kind": "image", + "metadata": "", + "name": "assets\\SquareWhiteBackground.png", + "smoothed": true, + "userAdded": false + } + ] + }, + "objects": [], + "objectsFolderStructure": { + "folderName": "__ROOT" + }, + "objectsGroups": [], + "variables": [], + "layouts": [ + { + "b": 192, + "disableInputWhenNotFocused": true, + "mangledName": "Untitled_32scene", + "name": "Untitled scene", + "r": 192, + "standardSortMethod": true, + "stopSoundsOnStartup": true, + "title": "", + "v": 192, + "uiSettings": { + "grid": true, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": true, + "zoomFactor": 0.6672773998330053, + "windowMask": false, + "selectedLayer": "", + "gameEditorMode": "instances-editor" + }, + "objectsGroups": [], + "variables": [], + "instances": [ + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "GreenRoundedScrollBar", + "persistentUuid": "846b0d59-1308-4616-ad4d-ce1fa84a9a85", + "width": 0, + "x": 32, + "y": 32, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "BlueRoundedScrollBar", + "persistentUuid": "0c0fb9d0-749b-423e-a4b5-c3f712e7814c", + "width": 0, + "x": 96, + "y": 32, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "GreyRoundedScrollBar", + "persistentUuid": "39ad6050-a907-41e0-b4cb-0a12d3a5e650", + "width": 0, + "x": 160, + "y": 32, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "RedRoundedScrollBar", + "persistentUuid": "de67383b-669c-466d-aa5d-c6b5e08bd1b6", + "width": 0, + "x": 224, + "y": 32, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "YellowRoundedScrollBar", + "persistentUuid": "c0f03658-336d-412d-9708-3b3649639466", + "width": 0, + "x": 288, + "y": 32, + "zOrder": 5, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "WhiteFantasyPixelScrollBar", + "persistentUuid": "7ff1f6ad-c044-489b-a3a5-73dcfb9b7189", + "width": 0, + "x": 352, + "y": 32, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "BlueTinySwordsPixelScrollBar", + "persistentUuid": "7f72ba0c-78a6-4988-9015-ea7524faf043", + "width": 0, + "x": 416, + "y": 32, + "zOrder": 7, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "RedTinySwordsPixelScrollBar", + "persistentUuid": "7483a6ab-7e78-422d-a799-c65be7a48d75", + "width": 0, + "x": 480, + "y": 32, + "zOrder": 8, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 50, + "layer": "", + "name": "White1BitPixelScrollBar", + "persistentUuid": "8143af4e-5417-4892-9fe5-86523ec83c1b", + "width": 2, + "x": 608, + "y": 32, + "zOrder": 9, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 64, + "height": 250, + "layer": "", + "name": "SquareWhiteScrollBar", + "persistentUuid": "88155e6d-e1f7-4b7c-8b7f-dbf9b31eb0fa", + "width": 12, + "x": 544, + "y": 32, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "objects": [ + { + "assetStoreId": "c4192231e4f1dc23581cdecf42e2890b0c81e8a93ec7b34ff4f63cf992279d29", + "name": "GreenRoundedScrollBar", + "type": "Scrollbar::Scrollbar", + "variant": "Green rounded scroll bar", + "variables": [], + "effects": [], + "behaviors": [], + "content": {} + }, + { + "assetStoreId": "c4192231e4f1dc23581cdecf42e2890b0c81e8a93ec7b34ff4f63cf992279d29", + "name": "BlueRoundedScrollBar", + "type": "Scrollbar::Scrollbar", + "variant": "Blue rounded scroll bar", + "variables": [], + "effects": [], + "behaviors": [], + "content": {} + }, + { + "assetStoreId": "c4192231e4f1dc23581cdecf42e2890b0c81e8a93ec7b34ff4f63cf992279d29", + "name": "GreyRoundedScrollBar", + "persistentUuid": "1e56ac78-e8b9-476b-981d-b580d4443505", + "type": "Scrollbar::Scrollbar", + "variant": "Grey rounded scroll bar", + "variables": [], + "effects": [], + "behaviors": [], + "content": {} + }, + { + "assetStoreId": "c4192231e4f1dc23581cdecf42e2890b0c81e8a93ec7b34ff4f63cf992279d29", + "name": "RedRoundedScrollBar", + "persistentUuid": "503d0a9a-d83c-4674-8721-9d846f102dd0", + "type": "Scrollbar::Scrollbar", + "variant": "Red rounded scroll bar", + "variables": [], + "effects": [], + "behaviors": [], + "content": {} + }, + { + "assetStoreId": "c4192231e4f1dc23581cdecf42e2890b0c81e8a93ec7b34ff4f63cf992279d29", + "name": "YellowRoundedScrollBar", + "type": "Scrollbar::Scrollbar", + "variant": "Yellow rounded scroll bar", + "variables": [], + "effects": [], + "behaviors": [], + "content": {} + }, + { + "assetStoreId": "c4192231e4f1dc23581cdecf42e2890b0c81e8a93ec7b34ff4f63cf992279d29", + "name": "WhiteFantasyPixelScrollBar", + "type": "Scrollbar::Scrollbar", + "variant": "White fantasy pixel scroll bar", + "variables": [], + "effects": [], + "behaviors": [], + "content": {} + }, + { + "assetStoreId": "c4192231e4f1dc23581cdecf42e2890b0c81e8a93ec7b34ff4f63cf992279d29", + "name": "BlueTinySwordsPixelScrollBar", + "type": "Scrollbar::Scrollbar", + "variant": "Blue tinyswords pixel scroll bar", + "variables": [], + "effects": [], + "behaviors": [], + "content": {} + }, + { + "assetStoreId": "c4192231e4f1dc23581cdecf42e2890b0c81e8a93ec7b34ff4f63cf992279d29", + "name": "RedTinySwordsPixelScrollBar", + "type": "Scrollbar::Scrollbar", + "variant": "Red tinyswords pixel scroll bar", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "ThumbLengthMin": 40 + } + }, + { + "assetStoreId": "c4192231e4f1dc23581cdecf42e2890b0c81e8a93ec7b34ff4f63cf992279d29", + "name": "White1BitPixelScrollBar", + "persistentUuid": "d3f213f9-39d0-4f03-bc85-725c637771b3", + "type": "Scrollbar::Scrollbar", + "variant": "White 1bit pixel scroll bar", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "ThumbLengthMin": 6 + } + }, + { + "assetStoreId": "c4192231e4f1dc23581cdecf42e2890b0c81e8a93ec7b34ff4f63cf992279d29", + "name": "SquareWhiteScrollBar", + "persistentUuid": "42ec19c4-a66f-4d26-be32-0e78c65a8e6c", + "type": "Scrollbar::Scrollbar", + "variant": "Square white scroll bar", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "ThumbLengthMin": 24 + } + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "GreenRoundedScrollBar" + }, + { + "objectName": "BlueRoundedScrollBar" + }, + { + "objectName": "GreyRoundedScrollBar" + }, + { + "objectName": "RedRoundedScrollBar" + }, + { + "objectName": "YellowRoundedScrollBar" + }, + { + "objectName": "WhiteFantasyPixelScrollBar" + }, + { + "objectName": "BlueTinySwordsPixelScrollBar" + }, + { + "objectName": "RedTinySwordsPixelScrollBar" + }, + { + "objectName": "SquareWhiteScrollBar" + }, + { + "objectName": "White1BitPixelScrollBar" + } + ] + }, + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneJustBegins" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "CenterCameraOnObject" + }, + "parameters": [ + "", + "White1BitPixelScrollBar", + "", + "", + "" + ] + }, + { + "type": { + "value": "ZoomCamera" + }, + "parameters": [ + "", + "3", + "", + "" + ] + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [ + { + "effectType": "Scene3D::HemisphereLight", + "name": "3D Ambient Hemisphere Light", + "doubleParameters": { + "elevation": 40, + "intensity": 0.33, + "rotation": 300 + }, + "stringParameters": { + "groundColor": "127;127;127", + "skyColor": "255;255;255", + "top": "Z+" + }, + "booleanParameters": {} + }, + { + "effectType": "Scene3D::DirectionalLight", + "name": "3D Sun Light", + "doubleParameters": { + "distanceFromCamera": 1500, + "elevation": 40, + "frustumSize": 4000, + "intensity": 0.75, + "minimumShadowBias": 0, + "rotation": 300 + }, + "stringParameters": { + "color": "255;255;255", + "shadowQuality": "medium", + "top": "Z+" + }, + "booleanParameters": { + "isCastingShadow": true + } + } + ] + } + ], + "behaviorsSharedData": [ + { + "name": "Effect", + "type": "EffectCapability::EffectBehavior" + }, + { + "name": "Flippable", + "type": "FlippableCapability::FlippableBehavior" + }, + { + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" + }, + { + "name": "Resizable", + "type": "ResizableCapability::ResizableBehavior" + } + ] + } + ], + "externalEvents": [], + "eventsFunctionsExtensions": [ + { + "author": "", + "category": "User interface", + "dimension": "", + "extensionNamespace": "", + "fullName": "Scrollbar", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTIxLDExSDExVjNjMC0xLjEsMC45LTIsMi0yaDZjMS4xLDAsMiwwLjksMiwyVjExeiIvPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTE5LDMxaC02Yy0xLjEsMC0yLTAuOS0yLTJ2LThoMTB2OEMyMSwzMC4xLDIwLjEsMzEsMTksMzF6Ii8+DQo8cmVjdCB4PSIxMSIgeT0iMTEiIGNsYXNzPSJzdDAiIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMTQsNyAxNiw1IDE4LDcgIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSIxOCwyNSAxNiwyNyAxNCwyNSAiLz4NCjwvc3ZnPg0K", + "name": "Scrollbar", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Interface Elements/c1313ac0735bd1c08d7327fd9a56b4d8cebf1b343f9ba82f1b141358433e1cdb_Interface Elements_interface_ui_scroll_bar_scrollbar.svg", + "shortDescription": "A scrollbar to help making a scroll view.", + "version": "1.0.0", + "description": [ + "A scrollbar to help making a scroll view.", + "", + "An example of scroll view can be found in the [multiplayer custom lobbies](https://wiki.gdevelop.io/gdevelop5/extensions/multiplayer-custom-lobbies/) extension." + ], + "origin": { + "identifier": "Scrollbar", + "name": "gdevelop-extension-store" + }, + "tags": [ + "scroll", + "bar" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "dt0tRnf2kHWJnjkrpnzTzNj9Yc63", + "QjE1CI3drHNR9Wklz2gTC5WbEgh1" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [ + { + "areaMaxX": 10, + "areaMaxY": 500, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "assetStoreTag": "scrollbars", + "defaultName": "", + "description": "A scrollbar to help making a scroll view.", + "fullName": "Scrollbar", + "isInnerAreaFollowingParentSize": true, + "isUsingLegacyInstancesRenderer": false, + "name": "Scrollbar", + "objects": [ + { + "assetStoreId": "", + "bottomMargin": 4, + "height": 60, + "leftMargin": 4, + "name": "Background", + "rightMargin": 4, + "texture": "", + "tiled": false, + "topMargin": 4, + "type": "PanelSpriteObject::PanelSprite", + "width": 16, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "rightEdgeAnchor": 2, + "bottomEdgeAnchor": 2, + "topEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 4, + "height": 60, + "leftMargin": 4, + "name": "Thumb", + "rightMargin": 4, + "texture": "", + "tiled": false, + "topMargin": 4, + "type": "PanelSpriteObject::PanelSprite", + "width": 16, + "variables": [ + { + "name": "StartScrollY", + "type": "number", + "value": 0 + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Draggable", + "type": "DraggableBehavior::Draggable", + "checkCollisionMask": true + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Background" + }, + { + "objectName": "Thumb" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 500, + "layer": "", + "name": "Background", + "persistentUuid": "0fda928c-9157-49d3-9264-081632e9dcf9", + "width": 10, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 60, + "layer": "", + "name": "Thumb", + "persistentUuid": "f8ff1fce-21b4-4ec1-8716-dc38dd6a7c6f", + "width": 10, + "x": 0, + "y": 0, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": [], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Scrollbar::Scrollbar::SetScrollPosition" + }, + "parameters": [ + "Object", + "=", + "0", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Scrollbar::Scrollbar::IsScrollingRequired" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Thumb", + "Draggable", + "no" + ] + }, + { + "type": { + "value": "Scrollbar::Scrollbar::SetScrollPosition" + }, + "parameters": [ + "Object", + "=", + "0", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "ShouldHideWhenUseless", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Background" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Thumb" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Scrollbar::Scrollbar::IsScrollingRequired" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Thumb", + "Draggable", + "yes" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Background", + "" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Thumb", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SourisSurObjet" + }, + "parameters": [ + "Background", + "", + "", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "DraggableBehavior::Dragged" + }, + "parameters": [ + "Thumb", + "Draggable" + ] + }, + { + "type": { + "value": "MouseButtonFromTextReleased" + }, + "parameters": [ + "", + "\"Left\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CursorY" + }, + "parameters": [ + "", + "<", + "Thumb.Y()", + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scrollbar::Scrollbar::SetScrollPosition" + }, + "parameters": [ + "Object", + "-", + "ContentLength", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CursorY" + }, + "parameters": [ + "", + ">", + "Thumb.Y() + Thumb.Height()", + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scrollbar::Scrollbar::SetScrollPosition" + }, + "parameters": [ + "Object", + "+", + "ContentLength", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Scrollbar::Scrollbar::IsThumbDragged" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scrollbar::Scrollbar::SetScrollPosition" + }, + "parameters": [ + "Object", + "=", + "(Thumb.Y() - Background.Y()) * ContentLength / Background.Height()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make sure the ScrollPosition don't go over the limit when the limit when the parent is resized." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scrollbar::Scrollbar::SetScrollPosition" + }, + "parameters": [ + "Object", + "=", + "ScrollPosition", + "" + ] + }, + { + "type": { + "value": "Scrollbar::Scrollbar::UpdateThumbPosition" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scrollbar::Scrollbar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Update the thumb position.", + "fullName": "Update thumb position", + "functionType": "Action", + "name": "UpdateThumbPosition", + "private": true, + "sentence": "Update thumb position of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Thumb", + "=", + "Background.X()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "Thumb", + "Resizable", + "=", + "max(ThumbLengthMin, Background.Height() * Background.Height() / ContentLength)" + ] + }, + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Thumb", + "=", + "clamp(Background.Y(), Background.Y() + Background.Height(), Background.Y() + ScrollPosition * Background.Height() / ContentLength)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scrollbar::Scrollbar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the scroll position.", + "fullName": "Scroll position", + "functionType": "ExpressionAndCondition", + "name": "ScrollPosition", + "sentence": "the scroll position", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ScrollPosition" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scrollbar::Scrollbar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ScrollPosition", + "name": "SetScrollPosition", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ScrollPosition", + "=", + "clamp(Value, 0, max(0, ContentLength - Background.Height()))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scrollbar::Scrollbar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the content length of the object. The length of the content to scroll. The scroll bar don't actually scroll the content. You have to do it yourself with camera actions.", + "fullName": "Content length", + "functionType": "ExpressionAndCondition", + "name": "ContentLength", + "sentence": "the content length", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ContentLength" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scrollbar::Scrollbar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ContentLength", + "name": "SetContentLength", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ContentLength", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scrollbar::Scrollbar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the thumb of the scrollbar is dragged.", + "fullName": "Thumb is dragged", + "functionType": "Condition", + "name": "IsThumbDragged", + "sentence": "The thumb of _PARAM0_ is dragged", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "DraggableBehavior::Dragged" + }, + "parameters": [ + "Thumb", + "Draggable" + ] + }, + { + "type": { + "value": "DraggableBehavior::Dropped" + }, + "parameters": [ + "Thumb", + "Draggable" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scrollbar::Scrollbar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the content is big enough to require scrolling.", + "fullName": "Scrolling is required", + "functionType": "Condition", + "name": "IsScrollingRequired", + "sentence": "The content of _PARAM0_ is big enough to require scrolling", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ResizableCapability::ResizableBehavior::Height" + }, + "parameters": [ + "Background", + "Resizable", + "<", + "ContentLength" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scrollbar::Scrollbar", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Scroll position", + "hidden": true, + "name": "ScrollPosition" + }, + { + "value": "2000", + "type": "Number", + "unit": "Pixel", + "label": "Content length", + "description": "The length of the content to scroll. The scroll bar don't actually scroll the content. You have to do it yourself with camera actions.", + "hidden": true, + "name": "ContentLength" + }, + { + "value": "40", + "type": "Number", + "unit": "Pixel", + "label": "Min thumb length", + "name": "ThumbLengthMin" + }, + { + "value": "true", + "type": "Boolean", + "label": "Hide the bar when the content is too small", + "name": "ShouldHideWhenUseless" + } + ], + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "ScrollPosition" + }, + { + "propertyName": "ContentLength" + }, + { + "propertyName": "ThumbLengthMin" + }, + { + "propertyName": "ShouldHideWhenUseless" + } + ] + }, + "variants": [ + { + "areaMaxX": 12, + "areaMaxY": 250, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "Square white scroll bar", + "objects": [ + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 2, + "leftMargin": 0, + "name": "Background", + "rightMargin": 0, + "texture": "assets\\SquareWhiteBackground.png", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 2, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "bottomEdgeAnchor": 2, + "topEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 4, + "height": 12, + "leftMargin": 0, + "name": "Thumb", + "rightMargin": 0, + "texture": "assets\\SquareWhiteThumb.png", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 12, + "variables": [ + { + "name": "StartScrollY", + "type": "number", + "value": 0 + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Draggable", + "type": "DraggableBehavior::Draggable", + "checkCollisionMask": true + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Background" + }, + { + "objectName": "Thumb" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 250, + "layer": "", + "name": "Background", + "persistentUuid": "0fda928c-9157-49d3-9264-081632e9dcf9", + "width": 12, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 24, + "layer": "", + "name": "Thumb", + "persistentUuid": "f8ff1fce-21b4-4ec1-8716-dc38dd6a7c6f", + "width": 12, + "x": 0, + "y": 0, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 1.8253766734567465, + "windowMask": false, + "selectedLayer": "", + "gameEditorMode": "instances-editor" + } + }, + { + "areaMaxX": 2, + "areaMaxY": 50, + "areaMaxZ": 1, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "White 1bit pixel scroll bar", + "objects": [ + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 40, + "leftMargin": 0, + "name": "Background", + "rightMargin": 0, + "texture": "assets\\BlackSquarePixelBackground.png", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 2, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "bottomEdgeAnchor": 2, + "topEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 6, + "leftMargin": 0, + "name": "Thumb", + "rightMargin": 0, + "texture": "assets\\White1BitSquareThumb.png", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 2, + "variables": [ + { + "name": "StartScrollY", + "type": "number", + "value": 0 + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Draggable", + "type": "DraggableBehavior::Draggable", + "checkCollisionMask": true + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Background" + }, + { + "objectName": "Thumb" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 50, + "layer": "", + "name": "Background", + "persistentUuid": "0fda928c-9157-49d3-9264-081632e9dcf9", + "width": 2, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 6, + "layer": "", + "name": "Thumb", + "persistentUuid": "f8ff1fce-21b4-4ec1-8716-dc38dd6a7c6f", + "width": 2, + "x": 0, + "y": 0, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 7.5977320393460035, + "windowMask": false, + "selectedLayer": "", + "gameEditorMode": "instances-editor" + } + }, + { + "areaMaxX": 30, + "areaMaxY": 500, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "Red tinyswords pixel scroll bar", + "objects": [ + { + "assetStoreId": "", + "bottomMargin": 6, + "height": 40, + "leftMargin": 6, + "name": "Background", + "rightMargin": 6, + "texture": "assets\\BlackTinySwordsPixelBackground.png", + "tiled": false, + "topMargin": 6, + "type": "PanelSpriteObject::PanelSprite", + "width": 30, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "bottomEdgeAnchor": 2, + "topEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 22, + "height": 60, + "leftMargin": 14, + "name": "Thumb", + "rightMargin": 14, + "texture": "assets\\RedTinySwordsPixelThumb.png", + "tiled": false, + "topMargin": 14, + "type": "PanelSpriteObject::PanelSprite", + "width": 30, + "variables": [ + { + "name": "StartScrollY", + "type": "number", + "value": 0 + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Draggable", + "type": "DraggableBehavior::Draggable", + "checkCollisionMask": true + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Background" + }, + { + "objectName": "Thumb" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 500, + "layer": "", + "name": "Background", + "persistentUuid": "0fda928c-9157-49d3-9264-081632e9dcf9", + "width": 30, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 60, + "layer": "", + "name": "Thumb", + "persistentUuid": "f8ff1fce-21b4-4ec1-8716-dc38dd6a7c6f", + "width": 10, + "x": 0, + "y": 0, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 0.880005181852754, + "windowMask": false, + "selectedLayer": "", + "gameEditorMode": "instances-editor" + } + }, + { + "areaMaxX": 30, + "areaMaxY": 500, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "Blue tinyswords pixel scroll bar", + "objects": [ + { + "assetStoreId": "", + "bottomMargin": 6, + "height": 40, + "leftMargin": 6, + "name": "Background", + "rightMargin": 6, + "texture": "assets\\BlackTinySwordsPixelBackground.png", + "tiled": false, + "topMargin": 6, + "type": "PanelSpriteObject::PanelSprite", + "width": 30, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "bottomEdgeAnchor": 2, + "topEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 22, + "height": 60, + "leftMargin": 14, + "name": "Thumb", + "rightMargin": 14, + "texture": "assets\\BlueTinySwordsPixelThumb.png", + "tiled": false, + "topMargin": 14, + "type": "PanelSpriteObject::PanelSprite", + "width": 30, + "variables": [ + { + "name": "StartScrollY", + "type": "number", + "value": 0 + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Draggable", + "type": "DraggableBehavior::Draggable", + "checkCollisionMask": true + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Background" + }, + { + "objectName": "Thumb" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 500, + "layer": "", + "name": "Background", + "persistentUuid": "0fda928c-9157-49d3-9264-081632e9dcf9", + "width": 30, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 60, + "layer": "", + "name": "Thumb", + "persistentUuid": "f8ff1fce-21b4-4ec1-8716-dc38dd6a7c6f", + "width": 10, + "x": 0, + "y": 0, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 1.5464547199971532, + "windowMask": false, + "selectedLayer": "", + "gameEditorMode": "instances-editor" + } + }, + { + "areaMaxX": 24, + "areaMaxY": 500, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "White fantasy pixel scroll bar", + "objects": [ + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 60, + "leftMargin": 0, + "name": "Background", + "rightMargin": 0, + "texture": "assets\\BlackSquarePixelBackground.png", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 24, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "bottomEdgeAnchor": 2, + "topEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 7, + "height": 60, + "leftMargin": 7, + "name": "Thumb", + "rightMargin": 7, + "texture": "assets\\WhiteFantasyPixelThumb.png", + "tiled": false, + "topMargin": 7, + "type": "PanelSpriteObject::PanelSprite", + "width": 24, + "variables": [ + { + "name": "StartScrollY", + "type": "number", + "value": 0 + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Draggable", + "type": "DraggableBehavior::Draggable", + "checkCollisionMask": true + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Background" + }, + { + "objectName": "Thumb" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 500, + "layer": "", + "name": "Background", + "persistentUuid": "0fda928c-9157-49d3-9264-081632e9dcf9", + "width": 24, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 60, + "layer": "", + "name": "Thumb", + "persistentUuid": "f8ff1fce-21b4-4ec1-8716-dc38dd6a7c6f", + "width": 10, + "x": 0, + "y": 0, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 2.4602543855909693, + "windowMask": false, + "selectedLayer": "", + "gameEditorMode": "instances-editor" + } + }, + { + "areaMaxX": 24, + "areaMaxY": 500, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "Yellow rounded scroll bar", + "objects": [ + { + "assetStoreId": "", + "bottomMargin": 6, + "height": 60, + "leftMargin": 6, + "name": "Background", + "rightMargin": 6, + "texture": "assets\\BlackRoundedSquareBackground.png", + "tiled": false, + "topMargin": 6, + "type": "PanelSpriteObject::PanelSprite", + "width": 24, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "bottomEdgeAnchor": 2, + "topEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 6, + "height": 60, + "leftMargin": 6, + "name": "Thumb", + "rightMargin": 6, + "texture": "assets\\YellowRoundedSquareThumb.png", + "tiled": false, + "topMargin": 6, + "type": "PanelSpriteObject::PanelSprite", + "width": 24, + "variables": [ + { + "name": "StartScrollY", + "type": "number", + "value": 0 + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Draggable", + "type": "DraggableBehavior::Draggable", + "checkCollisionMask": true + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Background" + }, + { + "objectName": "Thumb" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 500, + "layer": "", + "name": "Background", + "persistentUuid": "0fda928c-9157-49d3-9264-081632e9dcf9", + "width": 24, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 60, + "layer": "", + "name": "Thumb", + "persistentUuid": "f8ff1fce-21b4-4ec1-8716-dc38dd6a7c6f", + "width": 10, + "x": 0, + "y": 0, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 1.1860766270755787, + "windowMask": false, + "selectedLayer": "", + "gameEditorMode": "instances-editor" + } + }, + { + "areaMaxX": 24, + "areaMaxY": 500, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "Red rounded scroll bar", + "objects": [ + { + "assetStoreId": "", + "bottomMargin": 6, + "height": 60, + "leftMargin": 6, + "name": "Background", + "rightMargin": 6, + "texture": "assets\\BlackRoundedSquareBackground.png", + "tiled": false, + "topMargin": 6, + "type": "PanelSpriteObject::PanelSprite", + "width": 24, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "bottomEdgeAnchor": 2, + "topEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 6, + "height": 60, + "leftMargin": 6, + "name": "Thumb", + "rightMargin": 6, + "texture": "assets\\RedRoundedSquareThumb.png", + "tiled": false, + "topMargin": 6, + "type": "PanelSpriteObject::PanelSprite", + "width": 24, + "variables": [ + { + "name": "StartScrollY", + "type": "number", + "value": 0 + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Draggable", + "type": "DraggableBehavior::Draggable", + "checkCollisionMask": true + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Background" + }, + { + "objectName": "Thumb" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 500, + "layer": "", + "name": "Background", + "persistentUuid": "0fda928c-9157-49d3-9264-081632e9dcf9", + "width": 24, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 60, + "layer": "", + "name": "Thumb", + "persistentUuid": "f8ff1fce-21b4-4ec1-8716-dc38dd6a7c6f", + "width": 10, + "x": 0, + "y": 0, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 1.1860766270755787, + "windowMask": false, + "selectedLayer": "", + "gameEditorMode": "instances-editor" + } + }, + { + "areaMaxX": 24, + "areaMaxY": 500, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "Grey rounded scroll bar", + "objects": [ + { + "assetStoreId": "", + "bottomMargin": 6, + "height": 60, + "leftMargin": 6, + "name": "Background", + "rightMargin": 6, + "texture": "assets\\BlackRoundedSquareBackground.png", + "tiled": false, + "topMargin": 6, + "type": "PanelSpriteObject::PanelSprite", + "width": 24, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "bottomEdgeAnchor": 2, + "topEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 6, + "height": 60, + "leftMargin": 6, + "name": "Thumb", + "rightMargin": 6, + "texture": "assets\\GreyRoundedSquareThumb.png", + "tiled": false, + "topMargin": 6, + "type": "PanelSpriteObject::PanelSprite", + "width": 24, + "variables": [ + { + "name": "StartScrollY", + "type": "number", + "value": 0 + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Draggable", + "type": "DraggableBehavior::Draggable", + "checkCollisionMask": true + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Background" + }, + { + "objectName": "Thumb" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 500, + "layer": "", + "name": "Background", + "persistentUuid": "0fda928c-9157-49d3-9264-081632e9dcf9", + "width": 24, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 60, + "layer": "", + "name": "Thumb", + "persistentUuid": "f8ff1fce-21b4-4ec1-8716-dc38dd6a7c6f", + "width": 10, + "x": 0, + "y": 0, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 1.1860766270755787, + "windowMask": false, + "selectedLayer": "", + "gameEditorMode": "instances-editor" + } + }, + { + "areaMaxX": 24, + "areaMaxY": 500, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "Green rounded scroll bar", + "objects": [ + { + "assetStoreId": "", + "bottomMargin": 6, + "height": 60, + "leftMargin": 6, + "name": "Background", + "rightMargin": 6, + "texture": "assets\\BlackRoundedSquareBackground.png", + "tiled": false, + "topMargin": 6, + "type": "PanelSpriteObject::PanelSprite", + "width": 24, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "bottomEdgeAnchor": 2, + "topEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 6, + "height": 60, + "leftMargin": 6, + "name": "Thumb", + "rightMargin": 6, + "texture": "assets\\GreenRoundedSquareThumb.png", + "tiled": false, + "topMargin": 6, + "type": "PanelSpriteObject::PanelSprite", + "width": 24, + "variables": [ + { + "name": "StartScrollY", + "type": "number", + "value": 0 + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Draggable", + "type": "DraggableBehavior::Draggable", + "checkCollisionMask": true + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Background" + }, + { + "objectName": "Thumb" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 500, + "layer": "", + "name": "Background", + "persistentUuid": "0fda928c-9157-49d3-9264-081632e9dcf9", + "width": 24, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 60, + "layer": "", + "name": "Thumb", + "persistentUuid": "f8ff1fce-21b4-4ec1-8716-dc38dd6a7c6f", + "width": 10, + "x": 0, + "y": 0, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 1.1860766270755787, + "windowMask": false, + "selectedLayer": "", + "gameEditorMode": "instances-editor" + } + }, + { + "areaMaxX": 24, + "areaMaxY": 500, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "Blue rounded scroll bar", + "objects": [ + { + "assetStoreId": "", + "bottomMargin": 6, + "height": 60, + "leftMargin": 6, + "name": "Background", + "rightMargin": 6, + "texture": "assets\\BlackRoundedSquareBackground.png", + "tiled": false, + "topMargin": 6, + "type": "PanelSpriteObject::PanelSprite", + "width": 24, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "bottomEdgeAnchor": 2, + "topEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 6, + "height": 60, + "leftMargin": 6, + "name": "Thumb", + "rightMargin": 6, + "texture": "assets\\BlueRoundedSquareThumb.png", + "tiled": false, + "topMargin": 6, + "type": "PanelSpriteObject::PanelSprite", + "width": 24, + "variables": [ + { + "name": "StartScrollY", + "type": "number", + "value": 0 + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Draggable", + "type": "DraggableBehavior::Draggable", + "checkCollisionMask": true + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Background" + }, + { + "objectName": "Thumb" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 500, + "layer": "", + "name": "Background", + "persistentUuid": "0fda928c-9157-49d3-9264-081632e9dcf9", + "width": 24, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 60, + "layer": "", + "name": "Thumb", + "persistentUuid": "f8ff1fce-21b4-4ec1-8716-dc38dd6a7c6f", + "width": 10, + "x": 0, + "y": 0, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 1.1860766270755787, + "windowMask": false, + "selectedLayer": "", + "gameEditorMode": "instances-editor" + } + } + ] + } + ] + } + ], + "externalLayouts": [] +} \ No newline at end of file From 030d6bf5f97a920e2a4540af74912e4f0078bc2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 21 Apr 2026 11:13:22 +0200 Subject: [PATCH 2/2] Add the thumbnail extension --- .../variants-scrollbar.json | 441 ++++++++++++++++-- 1 file changed, 411 insertions(+), 30 deletions(-) diff --git a/examples/variants-scrollbar/variants-scrollbar.json b/examples/variants-scrollbar/variants-scrollbar.json index 745bfe117..215c174eb 100644 --- a/examples/variants-scrollbar/variants-scrollbar.json +++ b/examples/variants-scrollbar/variants-scrollbar.json @@ -1,7 +1,7 @@ { "firstLayout": "", "gdVersion": { - "build": 259, + "build": 264, "major": 5, "minor": 6, "revision": 0 @@ -53,7 +53,6 @@ "authorUsernames": [], "categories": [], "playableDevices": [ - "mobile", "mobile" ], "extensionProperties": [], @@ -209,23 +208,60 @@ "gridColor": 10401023, "gridAlpha": 0.8, "snap": true, - "zoomFactor": 0.6672773998330053, + "zoomFactor": 1.580468750000018, "windowMask": false, "selectedLayer": "", "gameEditorMode": "instances-editor" }, - "objectsGroups": [], + "objectsGroups": [ + { + "name": "Scrollbar", + "objects": [ + { + "name": "GreenRoundedScrollBar" + }, + { + "name": "BlueRoundedScrollBar" + }, + { + "name": "GreyRoundedScrollBar" + }, + { + "name": "RedRoundedScrollBar" + }, + { + "name": "YellowRoundedScrollBar" + }, + { + "name": "WhiteFantasyPixelScrollBar" + }, + { + "name": "BlueTinySwordsPixelScrollBar" + }, + { + "name": "RedTinySwordsPixelScrollBar" + }, + { + "name": "White1BitPixelScrollBar" + }, + { + "name": "SquareWhiteScrollBar" + } + ] + } + ], "variables": [], "instances": [ { "angle": 0, - "customSize": false, - "height": 0, + "customSize": true, + "depth": 64, + "height": 256, "keepRatio": true, "layer": "", "name": "GreenRoundedScrollBar", "persistentUuid": "846b0d59-1308-4616-ad4d-ce1fa84a9a85", - "width": 0, + "width": 24, "x": 32, "y": 32, "zOrder": 1, @@ -235,13 +271,14 @@ }, { "angle": 0, - "customSize": false, - "height": 0, + "customSize": true, + "depth": 64, + "height": 256, "keepRatio": true, "layer": "", "name": "BlueRoundedScrollBar", "persistentUuid": "0c0fb9d0-749b-423e-a4b5-c3f712e7814c", - "width": 0, + "width": 24, "x": 96, "y": 32, "zOrder": 2, @@ -251,13 +288,14 @@ }, { "angle": 0, - "customSize": false, - "height": 0, + "customSize": true, + "depth": 64, + "height": 256, "keepRatio": true, "layer": "", "name": "GreyRoundedScrollBar", "persistentUuid": "39ad6050-a907-41e0-b4cb-0a12d3a5e650", - "width": 0, + "width": 24, "x": 160, "y": 32, "zOrder": 3, @@ -267,13 +305,14 @@ }, { "angle": 0, - "customSize": false, - "height": 0, + "customSize": true, + "depth": 64, + "height": 256, "keepRatio": true, "layer": "", "name": "RedRoundedScrollBar", "persistentUuid": "de67383b-669c-466d-aa5d-c6b5e08bd1b6", - "width": 0, + "width": 24, "x": 224, "y": 32, "zOrder": 4, @@ -283,13 +322,14 @@ }, { "angle": 0, - "customSize": false, - "height": 0, + "customSize": true, + "depth": 64, + "height": 256, "keepRatio": true, "layer": "", "name": "YellowRoundedScrollBar", "persistentUuid": "c0f03658-336d-412d-9708-3b3649639466", - "width": 0, + "width": 24, "x": 288, "y": 32, "zOrder": 5, @@ -299,13 +339,14 @@ }, { "angle": 0, - "customSize": false, - "height": 0, + "customSize": true, + "depth": 64, + "height": 256, "keepRatio": true, "layer": "", "name": "WhiteFantasyPixelScrollBar", "persistentUuid": "7ff1f6ad-c044-489b-a3a5-73dcfb9b7189", - "width": 0, + "width": 24, "x": 352, "y": 32, "zOrder": 6, @@ -315,13 +356,14 @@ }, { "angle": 0, - "customSize": false, - "height": 0, + "customSize": true, + "depth": 64, + "height": 256, "keepRatio": true, "layer": "", "name": "BlueTinySwordsPixelScrollBar", "persistentUuid": "7f72ba0c-78a6-4988-9015-ea7524faf043", - "width": 0, + "width": 30, "x": 416, "y": 32, "zOrder": 7, @@ -331,13 +373,14 @@ }, { "angle": 0, - "customSize": false, - "height": 0, + "customSize": true, + "depth": 64, + "height": 256, "keepRatio": true, "layer": "", "name": "RedTinySwordsPixelScrollBar", "persistentUuid": "7483a6ab-7e78-422d-a799-c65be7a48d75", - "width": 0, + "width": 30, "x": 480, "y": 32, "zOrder": 8, @@ -349,7 +392,7 @@ "angle": 0, "customSize": true, "depth": 1, - "height": 50, + "height": 26, "layer": "", "name": "White1BitPixelScrollBar", "persistentUuid": "8143af4e-5417-4892-9fe5-86523ec83c1b", @@ -365,7 +408,7 @@ "angle": 0, "customSize": true, "depth": 64, - "height": 250, + "height": 128, "layer": "", "name": "SquareWhiteScrollBar", "persistentUuid": "88155e6d-e1f7-4b7c-8b7f-dbf9b31eb0fa", @@ -382,6 +425,7 @@ { "assetStoreId": "c4192231e4f1dc23581cdecf42e2890b0c81e8a93ec7b34ff4f63cf992279d29", "name": "GreenRoundedScrollBar", + "persistentUuid": "2110af19-8015-4cce-86a1-d10c6b0008e1", "type": "Scrollbar::Scrollbar", "variant": "Green rounded scroll bar", "variables": [], @@ -527,6 +571,7 @@ }, "events": [ { + "disabled": true, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { @@ -563,6 +608,64 @@ ] } ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneJustBegins" + }, + "parameters": [ + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Scrollbar", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scrollbar::Scrollbar::SetContentLength" + }, + "parameters": [ + "Scrollbar", + "=", + "Scrollbar.Height() * 3", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Wait" + }, + "parameters": [ + "0.5" + ] + }, + { + "type": { + "value": "RenderToFile::SaveAllObjectsImage" + }, + "parameters": [ + "", + "\"/home/davy/Téléchargements/AssetPreview\"", + "" + ] + } + ] + } + ] } ], "layers": [ @@ -689,6 +792,9 @@ "globalVariables": [], "sceneVariables": [], "eventsFunctions": [], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT" + }, "eventsBasedBehaviors": [], "eventsBasedObjects": [ { @@ -1472,6 +1578,35 @@ "objectGroups": [] } ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "doStepPostEvents" + }, + { + "functionName": "UpdateThumbPosition" + }, + { + "functionName": "ScrollPosition" + }, + { + "functionName": "SetScrollPosition" + }, + { + "functionName": "ContentLength" + }, + { + "functionName": "SetContentLength" + }, + { + "functionName": "IsThumbDragged" + }, + { + "functionName": "IsScrollingRequired" + } + ] + }, "propertyDescriptors": [ { "value": "0", @@ -3216,6 +3351,252 @@ ] } ] + }, + { + "author": "Arthur Pacaud (arthuro555)", + "category": "Advanced", + "dimension": "", + "extensionNamespace": "", + "fullName": "Render to file", + "gdevelopVersion": ">=5.5.222", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWNhbWVyYS1lbmhhbmNlIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTksM0w3LjE3LDVINEEyLDIgMCAwLDAgMiw3VjE5QTIsMiAwIDAsMCA0LDIxSDIwQTIsMiAwIDAsMCAyMiwxOVY3QTIsMiAwIDAsMCAyMCw1SDE2LjgzTDE1LDNNMTIsMThBNSw1IDAgMCwxIDcsMTNBNSw1IDAgMCwxIDEyLDhBNSw1IDAgMCwxIDE3LDEzQTUsNSAwIDAsMSAxMiwxOE0xMiwxN0wxMy4yNSwxNC4yNUwxNiwxM0wxMy4yNSwxMS43NUwxMiw5TDEwLjc1LDExLjc1TDgsMTNMMTAuNzUsMTQuMjUiIC8+PC9zdmc+", + "name": "RenderToFile", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/camera-enhance.svg", + "shortDescription": "Renders objects into PNG files.", + "version": "1.0.0", + "description": "Renders objects into PNG files.", + "tags": [], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const fs = typeof require !== 'undefined' ? require('fs/promises') : null;", + "const path = typeof require !== 'undefined' ? require('path') : null", + "", + "const rgbToHex = (rgbArray) => gdjs.rgbToHexNumber(rgbArray[0], rgbArray[1], rgbArray[2]);", + "", + "if (gdjs.PanelSpriteRuntimeObjectRenderer)", + "{", + " const originalEnsureUpToDate = gdjs.PanelSpriteRuntimeObjectRenderer.prototype.ensureUpToDate;", + " gdjs.PanelSpriteRuntimeObjectRenderer.prototype.ensureUpToDate = function () {", + " originalEnsureUpToDate.call(this);", + " this._spritesContainer.cacheAsBitmap = false;", + " }", + "}", + "if (gdjs.TextInputRuntimeObject)", + "{", + " gdjs.TextInputRuntimeObject.prototype.getRendererObject = function () {", + " /** @type {PIXI.Graphics} */", + " let graphics = this._renderer.graphics;", + " if (!graphics) {", + " graphics = new PIXI.Graphics();", + " this._renderer.graphics = graphics;", + " this.getInstanceContainer()", + " .getLayer('')", + " .getRenderer()", + " .addRendererObject(graphics, this.getZOrder());", + " ", + " const text = new PIXI.Text(' ', { align: 'left' });", + " graphics.addChild(text);", + " this._renderer.text = text;", + " }", + " return graphics;", + " }", + " const originalUpdatePreRender = gdjs.TextInputRuntimeObjectRenderer.prototype.updatePreRender;", + " gdjs.TextInputRuntimeObjectRenderer.prototype.updatePreRender = function () {", + " originalUpdatePreRender.call(this);", + " const object = this._object;", + " /** @type {PIXI.Graphics} */", + " const graphics = this.graphics;", + " /** @type {PIXI.Text} */", + " const text = this.text;", + " graphics.x = object.x;", + " graphics.y = object.y;", + " graphics.clear();", + " graphics.lineStyle(object._borderWidth, rgbToHex(object._borderColor), object._borderOpacity);", + " graphics.beginFill(rgbToHex(object._fillColor), object._fillOpacity);", + " graphics.drawRect(0, 0, object.getWidth(), object.getHeight());", + " graphics.endFill();", + " text.text = object._placeholder;", + " const style = text.style;", + " style.fontSize = object._fontSize;", + " style.fontFamily = '\"' + object.getInstanceContainer().getGame().getFontManager().getFontFamily(object._fontResourceName) + '\"';;", + " style.fill = \"#888\";", + " text.x = 4;", + " text.y = (object.getHeight() - object._fontSize) / 2;", + " }", + "}", + "", + "// Create a new application (extract will be auto-added to renderer)", + "const app = new PIXI.Application();", + "", + "/**", + " * @param object {gdjs.RuntimeObject}", + " * @param path {string}", + " */", + "async function saveObjectImage(object, path) {", + " if (!fs) {", + " return;", + " }", + " // Render the graphics as an HTMLImageElement", + " /** @type {HTMLImageElement} */", + " const image = await app.renderer.extract.image(object.getRendererObject());", + "", + " try {", + " await fs.writeFile(path, image.src", + " .replace('data:image/png;base64,', ''), 'base64');", + " }", + " catch (err) {", + " console.error(", + " 'Unable to save the screenshot at path: ' + path", + " );", + " }", + "}", + "", + "/**", + " * @param {string} pascalCaseName", + " * @returns {string}", + " */", + "const addSpacesToPascalCase = (pascalCaseName) => {", + " let name = pascalCaseName", + " .replace(/([A-Z]+|\\d+)/g, ' $1')", + " .replace(", + " /_(\\w)/g,", + " (", + " // @ts-ignore Unused", + " match,", + " $1", + " ) => ' ' + $1.toUpperCase()", + " )", + " .replace(/_/g, '')", + " .replace(/\\s+/g, ' ')", + " .trim();", + " name = name.charAt(0) === ' ' ? name.substring(1) : name;", + " return name;", + "};", + "", + "/**", + " * @param instanceContainer {gdjs.RuntimeInstanceContainer}", + " * @param folderPath {string}", + " */", + "async function saveAllObjectsImage(instanceContainer, folderPath) {", + " if (!fs) {", + " return;", + " }", + " for (const object of instanceContainer.getAdhocListOfAllInstances()) {", + " saveObjectImage(object, path.join(", + " folderPath, addSpacesToPascalCase(object.getName()) + '.preview.png'));", + " }", + "}", + "", + "gdjs.__renderToFileExtension = {", + " saveObjectImage,", + " saveAllObjectsImage", + "};", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Renders an object and puts the rendered image into a sprite object.", + "fullName": "Render an object into a file", + "functionType": "Action", + "name": "SaveObjectImage", + "sentence": "Render _PARAM1_ into file _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const objects = eventsFunctionContext.getObjects(\"Object\");", + "const path = eventsFunctionContext.getArgument(\"Path\");", + "", + "gdjs.__renderToFileExtension.saveObject(objects[0], path);", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The object to render", + "name": "Object", + "type": "objectList" + }, + { + "description": "Path", + "name": "Path", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Renders all the objects of the scene intoa folder.", + "fullName": "Render all objects into a file", + "functionType": "Action", + "name": "SaveAllObjectsImage", + "sentence": "Render all objects into folder _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const path = eventsFunctionContext.getArgument(\"Path\");", + "", + "gdjs.__renderToFileExtension.saveAllObjectsImage(runtimeScene, path);", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Folder", + "name": "Path", + "type": "string" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "onFirstSceneLoaded" + }, + { + "functionName": "SaveObjectImage" + }, + { + "functionName": "SaveAllObjectsImage" + } + ] + }, + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] } ], "externalLayouts": []