From 32d5d81b40ec29a33a4748e04bb0082aa2d9d2df Mon Sep 17 00:00:00 2001 From: asour <52638772+aMySour@users.noreply.github.com> Date: Sun, 14 Jul 2024 20:19:46 -0300 Subject: [PATCH] Deploy website - based on 1972b34b4a8ac49228f98f6c4b9f24c7a25ea517 --- 404.html | 6 +++--- api/components/index.html | 6 +++--- api/input/index.html | 6 +++--- api/intro/index.html | 6 +++--- api/scene/index.html | 6 +++--- api/simuloobject/index.html | 6 +++--- api/vec2/index.html | 6 +++--- assets/js/{22dd74f7.762b1890.js => 22dd74f7.ac5dcb9f.js} | 2 +- assets/js/26f6ec2d.c207375b.js | 1 - assets/js/26f6ec2d.dd53ac8d.js | 1 + assets/js/2c273a5f.864b1504.js | 1 - assets/js/2c273a5f.e4879d45.js | 1 + assets/js/35fb1769.1a3dc886.js | 1 - assets/js/35fb1769.dcd41dff.js | 1 + assets/js/5723fde7.32f39b40.js | 1 + assets/js/5723fde7.aeedb67a.js | 1 - assets/js/6a638f41.e2fd09a7.js | 1 - assets/js/6a638f41.f88bfe75.js | 1 + assets/js/70f34273.60538b94.js | 1 + assets/js/70f34273.8dbbe154.js | 1 - assets/js/d4f3c2d4.96e47e9f.js | 1 + assets/js/d4f3c2d4.a5995dc8.js | 1 - assets/js/d70d3333.4b047533.js | 1 - assets/js/d70d3333.c91612dc.js | 1 + assets/js/de828477.0759da02.js | 1 - assets/js/de828477.96011759.js | 1 + assets/js/f959785f.14a880bb.js | 1 - assets/js/f959785f.9441d3ba.js | 1 + assets/js/{main.b997f003.js => main.670b4723.js} | 4 ++-- ...97f003.js.LICENSE.txt => main.670b4723.js.LICENSE.txt} | 0 ...{runtime~main.21acea26.js => runtime~main.3aa6854c.js} | 2 +- category/components/index.html | 8 ++++---- index.html | 6 +++--- markdown-page/index.html | 6 +++--- samples/components/multifile/index.html | 6 +++--- samples/components/platformer/index.html | 6 +++--- samples/intro/index.html | 6 +++--- samples/reset/index.html | 6 +++--- samples/themes/index.html | 6 +++--- 39 files changed, 60 insertions(+), 60 deletions(-) rename assets/js/{22dd74f7.762b1890.js => 22dd74f7.ac5dcb9f.js} (64%) delete mode 100644 assets/js/26f6ec2d.c207375b.js create mode 100644 assets/js/26f6ec2d.dd53ac8d.js delete mode 100644 assets/js/2c273a5f.864b1504.js create mode 100644 assets/js/2c273a5f.e4879d45.js delete mode 100644 assets/js/35fb1769.1a3dc886.js create mode 100644 assets/js/35fb1769.dcd41dff.js create mode 100644 assets/js/5723fde7.32f39b40.js delete mode 100644 assets/js/5723fde7.aeedb67a.js delete mode 100644 assets/js/6a638f41.e2fd09a7.js create mode 100644 assets/js/6a638f41.f88bfe75.js create mode 100644 assets/js/70f34273.60538b94.js delete mode 100644 assets/js/70f34273.8dbbe154.js create mode 100644 assets/js/d4f3c2d4.96e47e9f.js delete mode 100644 assets/js/d4f3c2d4.a5995dc8.js delete mode 100644 assets/js/d70d3333.4b047533.js create mode 100644 assets/js/d70d3333.c91612dc.js delete mode 100644 assets/js/de828477.0759da02.js create mode 100644 assets/js/de828477.96011759.js delete mode 100644 assets/js/f959785f.14a880bb.js create mode 100644 assets/js/f959785f.9441d3ba.js rename assets/js/{main.b997f003.js => main.670b4723.js} (99%) rename assets/js/{main.b997f003.js.LICENSE.txt => main.670b4723.js.LICENSE.txt} (100%) rename assets/js/{runtime~main.21acea26.js => runtime~main.3aa6854c.js} (91%) diff --git a/404.html b/404.html index 16153d1..84023d2 100644 --- a/404.html +++ b/404.html @@ -3,9 +3,9 @@ -Simulo Docs - - +Simulo Docs + +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

diff --git a/api/components/index.html b/api/components/index.html index 15f0cce..3f7f29e 100644 --- a/api/components/index.html +++ b/api/components/index.html @@ -3,9 +3,9 @@ -Components | Simulo Docs - - +Components | Simulo Docs + +
Skip to main content

Components

diff --git a/api/input/index.html b/api/input/index.html index b4ebcc9..f0be9a2 100644 --- a/api/input/index.html +++ b/api/input/index.html @@ -3,9 +3,9 @@ -Input | Simulo Docs - - +Input | Simulo Docs + +

Input

diff --git a/api/intro/index.html b/api/intro/index.html index dd81793..8738c8a 100644 --- a/api/intro/index.html +++ b/api/intro/index.html @@ -3,9 +3,9 @@ -API Docs Introduction | Simulo Docs - - +API Docs Introduction | Simulo Docs + +

API Docs Introduction

diff --git a/api/scene/index.html b/api/scene/index.html index 62ba8bb..3a8b32d 100644 --- a/api/scene/index.html +++ b/api/scene/index.html @@ -3,9 +3,9 @@ -Scene | Simulo Docs - - +Scene | Simulo Docs + +

Scene

diff --git a/api/simuloobject/index.html b/api/simuloobject/index.html index 35e9e52..180012a 100644 --- a/api/simuloobject/index.html +++ b/api/simuloobject/index.html @@ -3,9 +3,9 @@ -SimuloObject | Simulo Docs - - +SimuloObject | Simulo Docs + +

SimuloObject

diff --git a/api/vec2/index.html b/api/vec2/index.html index d3d45a3..c5b6d27 100644 --- a/api/vec2/index.html +++ b/api/vec2/index.html @@ -3,9 +3,9 @@ -Vec2 | Simulo Docs - - +Vec2 | Simulo Docs + +

Vec2

diff --git a/assets/js/22dd74f7.762b1890.js b/assets/js/22dd74f7.ac5dcb9f.js similarity index 64% rename from assets/js/22dd74f7.762b1890.js rename to assets/js/22dd74f7.ac5dcb9f.js index b327515..ceaff74 100644 --- a/assets/js/22dd74f7.762b1890.js +++ b/assets/js/22dd74f7.ac5dcb9f.js @@ -1 +1 @@ -"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[567],{5226:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"apiSidebar":[{"type":"link","label":"API Docs Introduction","href":"/api/intro","docId":"api/intro","unlisted":false},{"type":"link","label":"Scene","href":"/api/scene/","docId":"api/scene/scene","unlisted":false},{"type":"link","label":"Vec2","href":"/api/vec2","docId":"api/vec2","unlisted":false},{"type":"link","label":"Components","href":"/api/components/","docId":"api/components/components","unlisted":false},{"type":"link","label":"Input","href":"/api/input/","docId":"api/input/input","unlisted":false},{"type":"link","label":"SimuloObject","href":"/api/simuloobject/","docId":"api/simuloobject/simuloobject","unlisted":false}],"samplesSidebar":[{"type":"link","label":"Samples","href":"/samples/intro","docId":"samples/intro","unlisted":false},{"type":"category","label":"Components","collapsible":true,"collapsed":false,"customProps":{"description":"Examples of component scripts"},"items":[{"type":"link","label":"Multi-File","href":"/samples/components/multifile","docId":"samples/components/multifile","unlisted":false},{"type":"link","label":"Platformer","href":"/samples/components/platformer","docId":"samples/components/platformer","unlisted":false}],"href":"/category/components"},{"type":"link","label":"Resetting The Scene","href":"/samples/reset","docId":"samples/reset","unlisted":false},{"type":"link","label":"Themes","href":"/samples/themes","docId":"samples/themes","unlisted":false}]},"docs":{"api/components/components":{"id":"api/components/components","title":"Components","description":"Components are scripts you place on objects in Simulo. They\'re very powerful and allow doing almost anything with scripting, even creating a platformer game in Simulo.","sidebar":"apiSidebar"},"api/input/input":{"id":"api/input/input","title":"Input","description":"The Input global provides functions relating to user input in the Simulo scene.","sidebar":"apiSidebar"},"api/intro":{"id":"api/intro","title":"API Docs Introduction","description":"Welcome to the Simulo API Docs! From here, you can learn all about the various parts of Simulo\'s Luau scripting API.","sidebar":"apiSidebar"},"api/scene/scene":{"id":"api/scene/scene","title":"Scene","description":"The Scene global provides fields and functions relating to the Simulo scene.","sidebar":"apiSidebar"},"api/simuloobject/simuloobject":{"id":"api/simuloobject/simuloobject","title":"SimuloObject","description":"All objects in a Simulo scene, such as boxes, circles, polygons, etc, are known to the API as s.","sidebar":"apiSidebar"},"api/vec2":{"id":"api/vec2","title":"Vec2","description":"is Simulo\'s built-in type for 2D vectors.","sidebar":"apiSidebar"},"samples/components/multifile":{"id":"samples/components/multifile","title":"Multi-File","description":"Instead of writing the component code inline in our Script Box script, we can use the temploadstring global:","sidebar":"samplesSidebar"},"samples/components/platformer":{"id":"samples/components/platformer","title":"Platformer","description":"Here\'s an example of a simple platformer parkour with components:","sidebar":"samplesSidebar"},"samples/intro":{"id":"samples/intro","title":"Samples","description":"Welcome to the Simulo samples, here we have some examples of Script Box scripts and Component scripts, etc.","sidebar":"samplesSidebar"},"samples/reset":{"id":"samples/reset","title":"Resetting The Scene","description":"The Simulo API currently has no built-in way to reset the scene to its default state. However, by using the following code, we can accomplish it anyway:","sidebar":"samplesSidebar"},"samples/themes":{"id":"samples/themes","title":"Themes","description":"We can create themes using scripts! Remember to run the reset function after defining it, or nothing will happen. We simply provide them without running them for convenience in copy-pasting them.","sidebar":"samplesSidebar"}}}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[567],{5226:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"apiSidebar":[{"type":"link","label":"API Docs Introduction","href":"/api/intro","docId":"api/intro","unlisted":false},{"type":"link","label":"Scene","href":"/api/scene/","docId":"api/scene/scene","unlisted":false},{"type":"link","label":"Vec2","href":"/api/vec2","docId":"api/vec2","unlisted":false},{"type":"link","label":"Components","href":"/api/components/","docId":"api/components/components","unlisted":false},{"type":"link","label":"Input","href":"/api/input/","docId":"api/input/input","unlisted":false},{"type":"link","label":"SimuloObject","href":"/api/simuloobject/","docId":"api/simuloobject/simuloobject","unlisted":false}],"samplesSidebar":[{"type":"link","label":"Samples","href":"/samples/intro","docId":"samples/intro","unlisted":false},{"type":"category","label":"Components","collapsible":true,"collapsed":false,"customProps":{"description":"Examples of component scripts"},"items":[{"type":"link","label":"Multi-File","href":"/samples/components/multifile","docId":"samples/components/multifile","unlisted":false},{"type":"link","label":"Platformer","href":"/samples/components/platformer","docId":"samples/components/platformer","unlisted":false}],"href":"/category/components"},{"type":"link","label":"Resetting The Scene","href":"/samples/reset","docId":"samples/reset","unlisted":false},{"type":"link","label":"Themes","href":"/samples/themes","docId":"samples/themes","unlisted":false}]},"docs":{"api/components/components":{"id":"api/components/components","title":"Components","description":"Components are scripts you place on objects in Simulo. They\'re very powerful and allow doing almost anything with scripting, even creating a platformer game in Simulo.","sidebar":"apiSidebar"},"api/input/input":{"id":"api/input/input","title":"Input","description":"The Input global provides functions relating to user input in the Simulo scene.","sidebar":"apiSidebar"},"api/intro":{"id":"api/intro","title":"API Docs Introduction","description":"Welcome to the Simulo API Docs! From here, you can learn all about the various parts of Simulo\'s Luau scripting API.","sidebar":"apiSidebar"},"api/scene/scene":{"id":"api/scene/scene","title":"Scene","description":"The Scene global provides fields and functions relating to the Simulo scene.","sidebar":"apiSidebar"},"api/simuloobject/simuloobject":{"id":"api/simuloobject/simuloobject","title":"SimuloObject","description":"API documentation for SimuloObjects","sidebar":"apiSidebar"},"api/vec2":{"id":"api/vec2","title":"Vec2","description":"Vec2 is Simulo\'s built-in type for 2D vectors.","sidebar":"apiSidebar"},"samples/components/multifile":{"id":"samples/components/multifile","title":"Multi-File","description":"Sample of how to work with Simulo Components in multiple files","sidebar":"samplesSidebar"},"samples/components/platformer":{"id":"samples/components/platformer","title":"Platformer","description":"Sample of a simple platformer parkour in Simulo\'s Scripting API","sidebar":"samplesSidebar"},"samples/intro":{"id":"samples/intro","title":"Samples","description":"Various samples of scripts with the Simulo Scripting API","sidebar":"samplesSidebar"},"samples/reset":{"id":"samples/reset","title":"Resetting The Scene","description":"Sample of how to reset the Simulo scene in scripting","sidebar":"samplesSidebar"},"samples/themes":{"id":"samples/themes","title":"Themes","description":"Sample of how to apply themes to the Simulo scene using scripting","sidebar":"samplesSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/26f6ec2d.c207375b.js b/assets/js/26f6ec2d.c207375b.js deleted file mode 100644 index 837a0d0..0000000 --- a/assets/js/26f6ec2d.c207375b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[801],{3823:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>r,default:()=>u,frontMatter:()=>l,metadata:()=>p,toc:()=>o});var t=s(4848),i=s(8453);const l={},r="Input",p={id:"api/input/input",title:"Input",description:"The Input global provides functions relating to user input in the Simulo scene.",source:"@site/docs/api/input/input.mdx",sourceDirName:"api/input",slug:"/api/input/",permalink:"/api/input/",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"apiSidebar",previous:{title:"Components",permalink:"/api/components/"},next:{title:"SimuloObject",permalink:"/api/simuloobject/"}},d={},o=[{value:"Functions",id:"functions",level:2},{value:"Input:pointer_pos()",id:"inputpointer_pos",level:3},{value:"Example",id:"example",level:4},{value:"Input:pointer_just_pressed()",id:"inputpointer_just_pressed",level:3},{value:"Example",id:"example-1",level:4},{value:"Input:pointer_just_released()",id:"inputpointer_just_released",level:3},{value:"Example",id:"example-2",level:4},{value:"Input:pointer_pressed()",id:"inputpointer_pressed",level:3},{value:"Example",id:"example-3",level:4},{value:"Input:key_just_pressed(...)",id:"inputkey_just_pressed",level:3},{value:"Example",id:"example-4",level:4},{value:"Input:key_just_released(...)",id:"inputkey_just_released",level:3},{value:"Example",id:"example-5",level:4},{value:"Input:key_pressed(...)",id:"inputkey_pressed",level:3},{value:"Example",id:"example-6",level:4}];function a(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",p:"p",pre:"pre",...(0,i.R)(),...e.components},{Type:s}=n;return s||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Type",!0),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"input",children:"Input"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"Input"})," global provides functions relating to user input in the Simulo scene."]}),"\n",(0,t.jsx)(n.admonition,{type:"warning",children:(0,t.jsx)(n.p,{children:"All of these APIs will change when multiplayer is added! But who knows when that will be Haha!"})}),"\n",(0,t.jsx)(n.h2,{id:"functions",children:"Functions"}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsxs)(n.p,{children:["Make sure to use ",(0,t.jsx)(n.code,{children:"Input:function()"})," and not ",(0,t.jsx)(n.code,{children:"Input.function()"}),", or you'll get an error"]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"inputpointer_pos",children:"Input:pointer_pos()"}),"\n",(0,t.jsxs)(n.p,{children:["Returns the position of the mouse pointer in the world as a ",(0,t.jsx)(s,{name:"vec2"}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"example",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local pos = Input:pointer_pos();\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"inputpointer_just_pressed",children:"Input:pointer_just_pressed()"}),"\n",(0,t.jsxs)(n.p,{children:["Returns whether the mouse left click was just pressed as a ",(0,t.jsx)(s,{name:"bool"}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"example-1",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"if Input:pointer_just_pressed() then\n -- do something\nend;\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"inputpointer_just_released",children:"Input:pointer_just_released()"}),"\n",(0,t.jsxs)(n.p,{children:["Returns whether the mouse left click was just released as a ",(0,t.jsx)(s,{name:"bool"}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"example-2",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"if Input:pointer_just_released() then\n -- do something\nend;\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"inputpointer_pressed",children:"Input:pointer_pressed()"}),"\n",(0,t.jsxs)(n.p,{children:["Returns whether the mouse left click is currently released as a ",(0,t.jsx)(s,{name:"bool"}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"example-3",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"if Input:pointer_pressed() then\n -- do something\nend;\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"inputkey_just_pressed",children:"Input:key_just_pressed(...)"}),"\n",(0,t.jsxs)(n.p,{children:["Returns whether the given key was just pressed as a ",(0,t.jsx)(s,{name:"bool"}),". Currently only supports ",(0,t.jsx)(n.code,{children:'"W"'}),", ",(0,t.jsx)(n.code,{children:'"A"'}),", ",(0,t.jsx)(n.code,{children:'"S"'})," and ",(0,t.jsx)(n.code,{children:'"D"'}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"example-4",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:'if Input:key_just_pressed("W") then\n -- do something\nend;\n'})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"inputkey_just_released",children:"Input:key_just_released(...)"}),"\n",(0,t.jsxs)(n.p,{children:["Returns whether the given key was just released as a ",(0,t.jsx)(s,{name:"bool"}),". Currently only supports ",(0,t.jsx)(n.code,{children:'"W"'}),", ",(0,t.jsx)(n.code,{children:'"A"'}),", ",(0,t.jsx)(n.code,{children:'"S"'})," and ",(0,t.jsx)(n.code,{children:'"D"'}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"example-5",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:'if Input:key_just_released("W") then\n -- do something\nend;\n'})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"inputkey_pressed",children:"Input:key_pressed(...)"}),"\n",(0,t.jsxs)(n.p,{children:["Returns whether the given key is currently pressed as a ",(0,t.jsx)(s,{name:"bool"}),". Currently only supports ",(0,t.jsx)(n.code,{children:'"W"'}),", ",(0,t.jsx)(n.code,{children:'"A"'}),", ",(0,t.jsx)(n.code,{children:'"S"'})," and ",(0,t.jsx)(n.code,{children:'"D"'}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"example-6",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:'if Input:key_pressed("W") then\n -- do something\nend;\n'})})]})}function u(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>p});var t=s(6540);const i={},l=t.createContext(i);function r(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function p(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/26f6ec2d.dd53ac8d.js b/assets/js/26f6ec2d.dd53ac8d.js new file mode 100644 index 0000000..2d049d0 --- /dev/null +++ b/assets/js/26f6ec2d.dd53ac8d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[801],{3823:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>r,default:()=>a,frontMatter:()=>l,metadata:()=>p,toc:()=>o});var t=s(4848),i=s(8453);const l={title:"Input",description:"The Input global provides functions relating to user input in the Simulo scene."},r="Input",p={id:"api/input/input",title:"Input",description:"The Input global provides functions relating to user input in the Simulo scene.",source:"@site/docs/api/input/input.mdx",sourceDirName:"api/input",slug:"/api/input/",permalink:"/api/input/",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{title:"Input",description:"The Input global provides functions relating to user input in the Simulo scene."},sidebar:"apiSidebar",previous:{title:"Components",permalink:"/api/components/"},next:{title:"SimuloObject",permalink:"/api/simuloobject/"}},d={},o=[{value:"Functions",id:"functions",level:2},{value:"Input:pointer_pos()",id:"inputpointer_pos",level:3},{value:"Example",id:"example",level:4},{value:"Input:pointer_just_pressed()",id:"inputpointer_just_pressed",level:3},{value:"Example",id:"example-1",level:4},{value:"Input:pointer_just_released()",id:"inputpointer_just_released",level:3},{value:"Example",id:"example-2",level:4},{value:"Input:pointer_pressed()",id:"inputpointer_pressed",level:3},{value:"Example",id:"example-3",level:4},{value:"Input:key_just_pressed(...)",id:"inputkey_just_pressed",level:3},{value:"Example",id:"example-4",level:4},{value:"Input:key_just_released(...)",id:"inputkey_just_released",level:3},{value:"Example",id:"example-5",level:4},{value:"Input:key_pressed(...)",id:"inputkey_pressed",level:3},{value:"Example",id:"example-6",level:4}];function u(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",p:"p",pre:"pre",...(0,i.R)(),...e.components},{Type:s}=n;return s||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Type",!0),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"input",children:"Input"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"Input"})," global provides functions relating to user input in the Simulo scene."]}),"\n",(0,t.jsx)(n.admonition,{type:"warning",children:(0,t.jsx)(n.p,{children:"All of these APIs will change when multiplayer is added! But who knows when that will be Haha!"})}),"\n",(0,t.jsx)(n.h2,{id:"functions",children:"Functions"}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsxs)(n.p,{children:["Make sure to use ",(0,t.jsx)(n.code,{children:"Input:function()"})," and not ",(0,t.jsx)(n.code,{children:"Input.function()"}),", or you'll get an error"]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"inputpointer_pos",children:"Input:pointer_pos()"}),"\n",(0,t.jsxs)(n.p,{children:["Returns the position of the mouse pointer in the world as a ",(0,t.jsx)(s,{name:"vec2"}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"example",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local pos = Input:pointer_pos();\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"inputpointer_just_pressed",children:"Input:pointer_just_pressed()"}),"\n",(0,t.jsxs)(n.p,{children:["Returns whether the mouse left click was just pressed as a ",(0,t.jsx)(s,{name:"bool"}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"example-1",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"if Input:pointer_just_pressed() then\n -- do something\nend;\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"inputpointer_just_released",children:"Input:pointer_just_released()"}),"\n",(0,t.jsxs)(n.p,{children:["Returns whether the mouse left click was just released as a ",(0,t.jsx)(s,{name:"bool"}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"example-2",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"if Input:pointer_just_released() then\n -- do something\nend;\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"inputpointer_pressed",children:"Input:pointer_pressed()"}),"\n",(0,t.jsxs)(n.p,{children:["Returns whether the mouse left click is currently released as a ",(0,t.jsx)(s,{name:"bool"}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"example-3",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"if Input:pointer_pressed() then\n -- do something\nend;\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"inputkey_just_pressed",children:"Input:key_just_pressed(...)"}),"\n",(0,t.jsxs)(n.p,{children:["Returns whether the given key was just pressed as a ",(0,t.jsx)(s,{name:"bool"}),". Currently only supports ",(0,t.jsx)(n.code,{children:'"W"'}),", ",(0,t.jsx)(n.code,{children:'"A"'}),", ",(0,t.jsx)(n.code,{children:'"S"'})," and ",(0,t.jsx)(n.code,{children:'"D"'}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"example-4",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:'if Input:key_just_pressed("W") then\n -- do something\nend;\n'})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"inputkey_just_released",children:"Input:key_just_released(...)"}),"\n",(0,t.jsxs)(n.p,{children:["Returns whether the given key was just released as a ",(0,t.jsx)(s,{name:"bool"}),". Currently only supports ",(0,t.jsx)(n.code,{children:'"W"'}),", ",(0,t.jsx)(n.code,{children:'"A"'}),", ",(0,t.jsx)(n.code,{children:'"S"'})," and ",(0,t.jsx)(n.code,{children:'"D"'}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"example-5",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:'if Input:key_just_released("W") then\n -- do something\nend;\n'})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"inputkey_pressed",children:"Input:key_pressed(...)"}),"\n",(0,t.jsxs)(n.p,{children:["Returns whether the given key is currently pressed as a ",(0,t.jsx)(s,{name:"bool"}),". Currently only supports ",(0,t.jsx)(n.code,{children:'"W"'}),", ",(0,t.jsx)(n.code,{children:'"A"'}),", ",(0,t.jsx)(n.code,{children:'"S"'})," and ",(0,t.jsx)(n.code,{children:'"D"'}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"example-6",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:'if Input:key_pressed("W") then\n -- do something\nend;\n'})})]})}function a(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>p});var t=s(6540);const i={},l=t.createContext(i);function r(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function p(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2c273a5f.864b1504.js b/assets/js/2c273a5f.864b1504.js deleted file mode 100644 index 2fce5a6..0000000 --- a/assets/js/2c273a5f.864b1504.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[306],{692:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>p,contentTitle:()=>s,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>c});var o=r(4848),t=r(8453);const a={},s="Platformer",l={id:"samples/components/platformer",title:"Platformer",description:"Here's an example of a simple platformer parkour with components:",source:"@site/docs/samples/components/platformer.mdx",sourceDirName:"samples/components",slug:"/samples/components/platformer",permalink:"/samples/components/platformer",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"samplesSidebar",previous:{title:"Multi-File",permalink:"/samples/components/multifile"},next:{title:"Resetting The Scene",permalink:"/samples/reset"}},p={},c=[];function i(e){const n={code:"code",h1:"h1",p:"p",pre:"pre",...(0,t.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"platformer",children:"Platformer"}),"\n",(0,o.jsx)(n.p,{children:"Here's an example of a simple platformer parkour with components:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-lua",children:'reset(); -- Add `reset` function from the samples so this works\n\n-- Add box for player\n\nlocal player = Scene:add_box({\n name = "player",\n position = vec2(2, -19.5),\n size = vec2(0.5, 0.5),\n is_static = false,\n color = 0xa0a0ff,\n});\n\nprint(player.guid);\n\nlocal hash = Scene:add_component({\n name = "Player Component",\n id = "@amytimed/test/player_component",\n version = "0.2.0",\n code = [[\n local speed = 5;\n local jump_force = 5;\n local parkour_x = 10;\n local parkour_y = -19;\n local parkour_size_x = 0.9;\n local parkour_gap = 5;\n local parkour_aa_e = 0;\n\n function on_start()\n print("start!!");\n spawn_parkour();\n end;\n\n function on_update()\n local current_vel = self:get_linear_velocity();\n\n local vel = vec2(0, current_vel.y);\n\n if Input:key_pressed("D") then\n vel.x = speed;\n end;\n if Input:key_pressed("A") then\n vel.x = -speed;\n end;\n if Input:key_just_pressed("W") then\n vel.y = jump_force;\n end;\n\n if (vel.x < 0 and current_vel.x > vel.x) or (vel.x > 0 and current_vel.x < vel.x) then\n self:set_linear_velocity(vec2(vel.x, vel.y));\n elseif vel.y > 0 then\n self:set_linear_velocity(vec2(current_vel.x, vel.y));\n end;\n\n self:set_angle(0);\n\n if self:get_position().x > parkour_x - 10 then\n spawn_parkour();\n end;\n end;\n\n function spawn_parkour()\n for i=0,2 do\n Scene:add_box({\n position = vec2(parkour_x, parkour_y),\n size = vec2(parkour_size_x, 0.2),\n color = 0xe5d3b9,\n is_static = true,\n --name = "Light"\n });\n\n if math.random(1, 5) == 4 then\n Scene:add_box({\n position = vec2(parkour_x + (parkour_size_x / 2), parkour_y + 1),\n size = vec2(0.1, 1.),\n color = 0xe5d3b9,\n is_static = true,\n });\n end;\n\n if math.random(1, 5) == 4 then\n Scene:add_box({\n position = vec2(parkour_x + (parkour_gap / 2), parkour_y + 6 + parkour_aa_e),\n size = vec2(0.1, 4.),\n color = 0xe5d3b9,\n is_static = true,\n });\n end;\n\n parkour_x += parkour_gap;\n parkour_gap *= 1.001;\n parkour_size_x /= 1.01;\n parkour_aa_e += 0.005;\n parkour_y += math.random(-0.5 - parkour_aa_e, 1.5 - parkour_aa_e);\n end;\n end;\n ]]\n});\n\nplayer:add_component(hash);\n\nprint(hash);\n'})})]})}function u(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(i,{...e})}):i(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>s,x:()=>l});var o=r(6540);const t={},a=o.createContext(t);function s(e){const n=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:s(e.components),o.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2c273a5f.e4879d45.js b/assets/js/2c273a5f.e4879d45.js new file mode 100644 index 0000000..7c4ba1a --- /dev/null +++ b/assets/js/2c273a5f.e4879d45.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[306],{692:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>p,contentTitle:()=>s,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>i});var o=r(4848),t=r(8453);const a={title:"Platformer",description:"Sample of a simple platformer parkour in Simulo's Scripting API"},s="Platformer",l={id:"samples/components/platformer",title:"Platformer",description:"Sample of a simple platformer parkour in Simulo's Scripting API",source:"@site/docs/samples/components/platformer.mdx",sourceDirName:"samples/components",slug:"/samples/components/platformer",permalink:"/samples/components/platformer",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{title:"Platformer",description:"Sample of a simple platformer parkour in Simulo's Scripting API"},sidebar:"samplesSidebar",previous:{title:"Multi-File",permalink:"/samples/components/multifile"},next:{title:"Resetting The Scene",permalink:"/samples/reset"}},p={},i=[];function c(e){const n={code:"code",h1:"h1",p:"p",pre:"pre",...(0,t.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"platformer",children:"Platformer"}),"\n",(0,o.jsx)(n.p,{children:"Here's an example of a simple platformer parkour with components:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-lua",children:'reset(); -- Add `reset` function from the samples so this works\n\n-- Add box for player\n\nlocal player = Scene:add_box({\n name = "player",\n position = vec2(2, -19.5),\n size = vec2(0.5, 0.5),\n is_static = false,\n color = 0xa0a0ff,\n});\n\nprint(player.guid);\n\nlocal hash = Scene:add_component({\n name = "Player Component",\n id = "@amytimed/test/player_component",\n version = "0.2.0",\n code = [[\n local speed = 5;\n local jump_force = 5;\n local parkour_x = 10;\n local parkour_y = -19;\n local parkour_size_x = 0.9;\n local parkour_gap = 5;\n local parkour_aa_e = 0;\n\n function on_start()\n print("start!!");\n spawn_parkour();\n end;\n\n function on_update()\n local current_vel = self:get_linear_velocity();\n\n local vel = vec2(0, current_vel.y);\n\n if Input:key_pressed("D") then\n vel.x = speed;\n end;\n if Input:key_pressed("A") then\n vel.x = -speed;\n end;\n if Input:key_just_pressed("W") then\n vel.y = jump_force;\n end;\n\n if (vel.x < 0 and current_vel.x > vel.x) or (vel.x > 0 and current_vel.x < vel.x) then\n self:set_linear_velocity(vec2(vel.x, vel.y));\n elseif vel.y > 0 then\n self:set_linear_velocity(vec2(current_vel.x, vel.y));\n end;\n\n self:set_angle(0);\n\n if self:get_position().x > parkour_x - 10 then\n spawn_parkour();\n end;\n end;\n\n function spawn_parkour()\n for i=0,2 do\n Scene:add_box({\n position = vec2(parkour_x, parkour_y),\n size = vec2(parkour_size_x, 0.2),\n color = 0xe5d3b9,\n is_static = true,\n --name = "Light"\n });\n\n if math.random(1, 5) == 4 then\n Scene:add_box({\n position = vec2(parkour_x + (parkour_size_x / 2), parkour_y + 1),\n size = vec2(0.1, 1.),\n color = 0xe5d3b9,\n is_static = true,\n });\n end;\n\n if math.random(1, 5) == 4 then\n Scene:add_box({\n position = vec2(parkour_x + (parkour_gap / 2), parkour_y + 6 + parkour_aa_e),\n size = vec2(0.1, 4.),\n color = 0xe5d3b9,\n is_static = true,\n });\n end;\n\n parkour_x += parkour_gap;\n parkour_gap *= 1.001;\n parkour_size_x /= 1.01;\n parkour_aa_e += 0.005;\n parkour_y += math.random(-0.5 - parkour_aa_e, 1.5 - parkour_aa_e);\n end;\n end;\n ]]\n});\n\nplayer:add_component(hash);\n\nprint(hash);\n'})})]})}function u(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(c,{...e})}):c(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>s,x:()=>l});var o=r(6540);const t={},a=o.createContext(t);function s(e){const n=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:s(e.components),o.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/35fb1769.1a3dc886.js b/assets/js/35fb1769.1a3dc886.js deleted file mode 100644 index a6b376e..0000000 --- a/assets/js/35fb1769.1a3dc886.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[736],{5742:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>c,default:()=>d,frontMatter:()=>r,metadata:()=>i,toc:()=>l});var s=n(4848),o=n(8453);const r={},c="Resetting The Scene",i={id:"samples/reset",title:"Resetting The Scene",description:"The Simulo API currently has no built-in way to reset the scene to its default state. However, by using the following code, we can accomplish it anyway:",source:"@site/docs/samples/reset.md",sourceDirName:"samples",slug:"/samples/reset",permalink:"/samples/reset",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"samplesSidebar",previous:{title:"Platformer",permalink:"/samples/components/platformer"},next:{title:"Themes",permalink:"/samples/themes"}},a={},l=[];function u(e){const t={code:"code",h1:"h1",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"resetting-the-scene",children:"Resetting The Scene"}),"\n",(0,s.jsx)(t.p,{children:"The Simulo API currently has no built-in way to reset the scene to its default state. However, by using the following code, we can accomplish it anyway:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-lua",children:"function reset()\n -- Get all objects in the scene\n local objs = Scene:get_all_objects();\n\n -- Loop from 1 to the number of objects, thus looping over all objects in the scene\n for i=1,#objs do\n objs[i]:destroy(); -- Destroy each object in objs\n end;\n\n Scene:set_gravity(vec2(0, -9.805)); -- Reset gravity\n Scene.background_color = 0x34213d; -- Reset background color\n\n -- Re-add the Simulo ground\n Scene:add_box({\n position = vec2(0, -120),\n size = vec2(1000, 100),\n color = 0xb9a1c4,\n is_static = true,\n });\nend;\n"})}),"\n",(0,s.jsxs)(t.p,{children:["After defining this in the Script Box, we can now run ",(0,s.jsx)(t.code,{children:"reset();"})," to clear the scene. This is very useful when prototyping or iterating on a script, as we can keep rerunning it without restarting the game."]})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>c,x:()=>i});var s=n(6540);const o={},r=s.createContext(o);function c(e){const t=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:c(e.components),s.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/35fb1769.dcd41dff.js b/assets/js/35fb1769.dcd41dff.js new file mode 100644 index 0000000..6740185 --- /dev/null +++ b/assets/js/35fb1769.dcd41dff.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[736],{5742:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>i,default:()=>u,frontMatter:()=>r,metadata:()=>c,toc:()=>l});var s=n(4848),o=n(8453);const r={title:"Resetting The Scene",description:"Sample of how to reset the Simulo scene in scripting"},i="Resetting The Scene",c={id:"samples/reset",title:"Resetting The Scene",description:"Sample of how to reset the Simulo scene in scripting",source:"@site/docs/samples/reset.md",sourceDirName:"samples",slug:"/samples/reset",permalink:"/samples/reset",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{title:"Resetting The Scene",description:"Sample of how to reset the Simulo scene in scripting"},sidebar:"samplesSidebar",previous:{title:"Platformer",permalink:"/samples/components/platformer"},next:{title:"Themes",permalink:"/samples/themes"}},a={},l=[];function p(e){const t={code:"code",h1:"h1",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"resetting-the-scene",children:"Resetting The Scene"}),"\n",(0,s.jsx)(t.p,{children:"The Simulo API currently has no built-in way to reset the scene to its default state. However, by using the following code, we can accomplish it anyway:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-lua",children:"function reset()\n -- Get all objects in the scene\n local objs = Scene:get_all_objects();\n\n -- Loop from 1 to the number of objects, thus looping over all objects in the scene\n for i=1,#objs do\n objs[i]:destroy(); -- Destroy each object in objs\n end;\n\n Scene:set_gravity(vec2(0, -9.805)); -- Reset gravity\n Scene.background_color = 0x34213d; -- Reset background color\n\n -- Re-add the Simulo ground\n Scene:add_box({\n position = vec2(0, -120),\n size = vec2(1000, 100),\n color = 0xb9a1c4,\n is_static = true,\n });\nend;\n"})}),"\n",(0,s.jsxs)(t.p,{children:["After defining this in the Script Box, we can now run ",(0,s.jsx)(t.code,{children:"reset();"})," to clear the scene. This is very useful when prototyping or iterating on a script, as we can keep rerunning it without restarting the game."]})]})}function u(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>c});var s=n(6540);const o={},r=s.createContext(o);function i(e){const t=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),s.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5723fde7.32f39b40.js b/assets/js/5723fde7.32f39b40.js new file mode 100644 index 0000000..6fd667f --- /dev/null +++ b/assets/js/5723fde7.32f39b40.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[976],{2541:(A,C,e)=>{e.r(C),e.d(C,{assets:()=>r,contentTitle:()=>B,default:()=>t,frontMatter:()=>Q,metadata:()=>o,toc:()=>c});var g=e(4848),n=e(8453);const Q={title:"Themes",description:"Sample of how to apply themes to the Simulo scene using scripting"},B="Themes",o={id:"samples/themes",title:"Themes",description:"Sample of how to apply themes to the Simulo scene using scripting",source:"@site/docs/samples/themes.mdx",sourceDirName:"samples",slug:"/samples/themes",permalink:"/samples/themes",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{title:"Themes",description:"Sample of how to apply themes to the Simulo scene using scripting"},sidebar:"samplesSidebar",previous:{title:"Resetting The Scene",permalink:"/samples/reset"}},r={},c=[{value:"Earth Theme",id:"earth-theme",level:2},{value:"Mars Theme",id:"mars-theme",level:2},{value:"Space Theme",id:"space-theme",level:2}];function s(A){const C={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,n.R)(),...A.components};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(C.h1,{id:"themes",children:"Themes"}),"\n",(0,g.jsxs)(C.p,{children:["We can create themes using scripts! Remember to run the ",(0,g.jsx)(C.code,{children:"reset"})," function after defining it, or nothing will happen. We simply provide them without running them for convenience in copy-pasting them."]}),"\n",(0,g.jsx)(C.h2,{id:"earth-theme",children:"Earth Theme"}),"\n",(0,g.jsx)(C.pre,{children:(0,g.jsx)(C.code,{className:"language-lua",children:"function reset()\n local ground_color = 0x4d9c0b;\n local background_color = 0x80bfff;\n\n Scene.background_color = background_color;\n\n local objs = Scene:get_all_objects();\n for i=1,#objs do\n objs[i]:destroy();\n end;\n\n Scene:set_gravity(vec2(0, -9.805))\n\n -- Ground\n Scene:add_box({\n position = vec2(0, -120),\n size = vec2(1000, 100),\n color = ground_color,\n is_static = true,\n });\nend;\n"})}),"\n",(0,g.jsx)(C.p,{children:(0,g.jsx)(C.img,{alt:"Earth Theme",src:e(5927).A+"",width:"933",height:"324"})}),"\n",(0,g.jsx)(C.h2,{id:"mars-theme",children:"Mars Theme"}),"\n",(0,g.jsx)(C.pre,{children:(0,g.jsx)(C.code,{className:"language-lua",children:"function reset()\n local ground_color = 0xab6533;\n local background_color = 0xad9778;\n\n Scene.background_color = background_color;\n\n local objs = Scene:get_all_objects();\n for i=1,#objs do\n objs[i]:destroy();\n end;\n\n Scene:set_gravity(vec2(0, -9.805))\n\n -- Ground\n Scene:add_box({\n position = vec2(0, -120),\n size = vec2(1000, 100),\n color = ground_color,\n is_static = true,\n });\nend;\n"})}),"\n",(0,g.jsx)(C.p,{children:(0,g.jsx)(C.img,{alt:"Mars Theme",src:e(8248).A+"",width:"930",height:"322"})}),"\n",(0,g.jsx)(C.h2,{id:"space-theme",children:"Space Theme"}),"\n",(0,g.jsx)(C.p,{children:"This one also changes gravity"}),"\n",(0,g.jsx)(C.pre,{children:(0,g.jsx)(C.code,{className:"language-lua",children:"function reset()\n local objs = Scene:get_all_objects();\n for i=1,#objs do\n objs[i]:destroy();\n end;\n Scene:set_gravity(vec2(0, 0));\n Scene.background_color = 0x000000;\nend;\n"})}),"\n",(0,g.jsx)(C.p,{children:(0,g.jsx)(C.img,{alt:"Space Theme",src:e(8969).A+"",width:"1013",height:"423"})})]})}function t(A={}){const{wrapper:C}={...(0,n.R)(),...A.components};return C?(0,g.jsx)(C,{...A,children:(0,g.jsx)(s,{...A})}):s(A)}},5927:(A,C,e)=>{e.d(C,{A:()=>g});const g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA6UAAAFECAIAAABQxA8fAAAAA3NCSVQICAjb4U/gAAAAGXRFWHRTb2Z0d2FyZQBnbm9tZS1zY3JlZW5zaG907wO/PgAABl9JREFUeJzt2rENg0AABEFAFG4R0hSVOHbqiBSqeL20mqngwg1u/VzPAgAAUdvsAQA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TkSuQmCC"},8248:(A,C,e)=>{e.d(C,{A:()=>g});const g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA6IAAAFCCAIAAABkQfd7AAAAA3NCSVQICAjb4U/gAAAAGXRFWHRTb2Z0d2FyZQBnbm9tZS1zY3JlZW5zaG907wO/PgAABlZJREFUeJzt2rENg0AABEFjfdHuhCrohpSY2BVAEy+9tJqp4MINbjv23wcAAFq+qwcAAMB8MhcAgCCZCwBAkMwFACBI5gIAECRzAQAIkrkAAATJXAAAgmQuAABBMhcAgCCZCwBAkMwFACBI5gIAECRzAQAIkrkAAATJXAAAgmQuAABBMhcAgCCZCwBAkMwFACBI5gIAECRzAQAIkrkAAATJXAAAgmQuAABBMhcAgCCZCwBAkMwFACBI5gIAECRzAQAIkrkAAATJXAAAgmQuAABBMhcAgCCZCwBAkMwFACBI5gIAECRzAQAIkrkAAATJXAAAgmQuAABBMhcAgCCZCwBAkMwFACBI5gIAECRzAQAIkrkAAATJXAAAgmQuAABBMhcAgCCZCwBAkMwFACBI5gIAECRzAQAIkrkAAATJXAAAgmQuAABBMhcAgCCZCwBAkMwFACBI5gIAECRzAQAIkrkAAATJXAAAgmQuAABBMhcAgCCZCwBAkMwFACBI5gIAECRzAQAIkrkAAATJXAAAgmQuAABBMhcAgCCZCwBAkMwFACBI5gIAECRzAQAIkrkAAATJXAAAgmQuAABBMhcAgCCZCwBAkMwFACBI5gIAECRzAQAIkrkAAATJXAAAgmQuAABBMhcAgCCZCwBAkMwFACBI5gIAECRzAQAIkrkAAATJXAAAgmQuAABBMhcAgCCZCwBAkMwFACBI5gIAECRzAQAIkrkAAATJXAAAgmQuAABBMhcAgCCZCwBAkMwFACBI5gIAECRzAQAIkrkAAATJXAAAgmQuAABBMhcAgCCZCwBAkMwFACBI5gIAECRzAQAIkrkAAATJXAAAgmQuAABBMhcAgCCZCwBAkMwFACBI5gIAECRzAQAIkrkAAATJXAAAgmQuAABBMhcAgCCZCwBAkMwFACBI5gIAECRzAQAIk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QGa2xP3N8/1jR2aDJgIgIfI9QN7e93CeyuP+o8dPo0cAiOH+HqBk1T6cR7kWqJZ8D1CRSuK+ci1QM/c5ABWp5E1byrVAzeR7gHpVEvcBqiLfA/BGMXFfuRaomft7AHYko7ivXAvUTL4HoB/Jxn3lWqBy7nMA6MeWY54mmRfrKtcClZPvAWjHlhfrJhL3AWoj3wMwFO+M+83wX6yrXAtUzv09AAE2z/dbj/vKtUDl5HsA4rUV95VrAdznABCvrUfvK9cCyPcAJKeYN20BdE++ByB1O4/7yrUA7u8ByNvbcd/xPQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJTg/wH+9c1S7cS4rQAAAABJRU5ErkJggg=="},8453:(A,C,e)=>{e.d(C,{R:()=>B,x:()=>o});var g=e(6540);const n={},Q=g.createContext(n);function B(A){const C=g.useContext(Q);return g.useMemo((function(){return"function"==typeof A?A(C):{...C,...A}}),[C,A])}function o(A){let C;return C=A.disableParentContext?"function"==typeof A.components?A.components(n):A.components||n:B(A.components),g.createElement(Q.Provider,{value:C},A.children)}}}]); \ No newline at end of file diff --git a/assets/js/5723fde7.aeedb67a.js b/assets/js/5723fde7.aeedb67a.js deleted file mode 100644 index 3afbb86..0000000 --- a/assets/js/5723fde7.aeedb67a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[976],{2541:(A,C,e)=>{e.r(C),e.d(C,{assets:()=>r,contentTitle:()=>B,default:()=>I,frontMatter:()=>Q,metadata:()=>o,toc:()=>c});var g=e(4848),n=e(8453);const Q={},B="Themes",o={id:"samples/themes",title:"Themes",description:"We can create themes using scripts! Remember to run the reset function after defining it, or nothing will happen. We simply provide them without running them for convenience in copy-pasting them.",source:"@site/docs/samples/themes.mdx",sourceDirName:"samples",slug:"/samples/themes",permalink:"/samples/themes",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"samplesSidebar",previous:{title:"Resetting The Scene",permalink:"/samples/reset"}},r={},c=[{value:"Earth Theme",id:"earth-theme",level:2},{value:"Mars Theme",id:"mars-theme",level:2},{value:"Space Theme",id:"space-theme",level:2}];function s(A){const C={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,n.R)(),...A.components};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(C.h1,{id:"themes",children:"Themes"}),"\n",(0,g.jsxs)(C.p,{children:["We can create themes using scripts! Remember to run the ",(0,g.jsx)(C.code,{children:"reset"})," function after defining it, or nothing will happen. We simply provide them without running them for convenience in copy-pasting them."]}),"\n",(0,g.jsx)(C.h2,{id:"earth-theme",children:"Earth Theme"}),"\n",(0,g.jsx)(C.pre,{children:(0,g.jsx)(C.code,{className:"language-lua",children:"function reset()\n local ground_color = 0x4d9c0b;\n local background_color = 0x80bfff;\n\n Scene.background_color = background_color;\n\n local objs = Scene:get_all_objects();\n for i=1,#objs do\n objs[i]:destroy();\n end;\n\n Scene:set_gravity(vec2(0, -9.805))\n\n -- Ground\n Scene:add_box({\n position = vec2(0, -120),\n size = vec2(1000, 100),\n color = ground_color,\n is_static = true,\n });\nend;\n"})}),"\n",(0,g.jsx)(C.p,{children:(0,g.jsx)(C.img,{alt:"Earth Theme",src:e(5927).A+"",width:"933",height:"324"})}),"\n",(0,g.jsx)(C.h2,{id:"mars-theme",children:"Mars Theme"}),"\n",(0,g.jsx)(C.pre,{children:(0,g.jsx)(C.code,{className:"language-lua",children:"function reset()\n local ground_color = 0xab6533;\n local background_color = 0xad9778;\n\n Scene.background_color = background_color;\n\n local objs = Scene:get_all_objects();\n for i=1,#objs do\n objs[i]:destroy();\n end;\n\n Scene:set_gravity(vec2(0, -9.805))\n\n -- Ground\n Scene:add_box({\n position = vec2(0, -120),\n size = vec2(1000, 100),\n color = ground_color,\n is_static = true,\n });\nend;\n"})}),"\n",(0,g.jsx)(C.p,{children:(0,g.jsx)(C.img,{alt:"Mars Theme",src:e(8248).A+"",width:"930",height:"322"})}),"\n",(0,g.jsx)(C.h2,{id:"space-theme",children:"Space Theme"}),"\n",(0,g.jsx)(C.p,{children:"This one also changes gravity"}),"\n",(0,g.jsx)(C.pre,{children:(0,g.jsx)(C.code,{className:"language-lua",children:"function reset()\n local objs = Scene:get_all_objects();\n for i=1,#objs do\n objs[i]:destroy();\n end;\n Scene:set_gravity(vec2(0, 0));\n Scene.background_color = 0x000000;\nend;\n"})}),"\n",(0,g.jsx)(C.p,{children:(0,g.jsx)(C.img,{alt:"Space Theme",src:e(8969).A+"",width:"1013",height:"423"})})]})}function I(A={}){const{wrapper:C}={...(0,n.R)(),...A.components};return C?(0,g.jsx)(C,{...A,children:(0,g.jsx)(s,{...A})}):s(A)}},5927:(A,C,e)=>{e.d(C,{A:()=>g});const g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA6UAAAFECAIAAABQxA8fAAAAA3NCSVQICAjb4U/gAAAAGXRFWHRTb2Z0d2FyZQBnbm9tZS1zY3JlZW5zaG907wO/PgAABl9JREFUeJzt2rENg0AABEFAFG4R0hSVOHbqiBSqeL20mqngwg1u/VzPAgAAUdvsAQAAMJDeBQCgTO8CAFCmdwEAKNO7AACU6V0AAMr0LgAAZXoXAIAyvQsAQJneBQCgTO8CAFCmdwEAKNO7AACU6V0AAMr0LgAAZXoXAIAyvQsAQJneBQCgTO8CAFCmdwEAKNO7AACU6V0AAMr0LgAAZXoXAIAyvQsAQJneBQCgTO8CAFCmdwEAKNO7AACU6V0AAMr0LgAAZXoXAIAyvQsAQJneBQCgTO8CAFCmdwEAKNO7AACU6V0AAMr0LgAAZXoXAIAyvQsAQJne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KeYN20BdE++ByB1O4/7yrUA7u8ByNvbcd/xPQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJTg/wH+9c1S7cS4rQAAAABJRU5ErkJggg=="},8453:(A,C,e)=>{e.d(C,{R:()=>B,x:()=>o});var g=e(6540);const n={},Q=g.createContext(n);function B(A){const C=g.useContext(Q);return g.useMemo((function(){return"function"==typeof A?A(C):{...C,...A}}),[C,A])}function o(A){let C;return C=A.disableParentContext?"function"==typeof A.components?A.components(n):A.components||n:B(A.components),g.createElement(Q.Provider,{value:C},A.children)}}}]); \ No newline at end of file diff --git a/assets/js/6a638f41.e2fd09a7.js b/assets/js/6a638f41.e2fd09a7.js deleted file mode 100644 index da0e948..0000000 --- a/assets/js/6a638f41.e2fd09a7.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[506],{8741:(e,n,l)=>{l.r(n),l.d(n,{assets:()=>o,contentTitle:()=>a,default:()=>h,frontMatter:()=>i,metadata:()=>c,toc:()=>r});var s=l(4848),t=l(8453);const i={},a="SimuloObject",c={id:"api/simuloobject/simuloobject",title:"SimuloObject",description:"All objects in a Simulo scene, such as boxes, circles, polygons, etc, are known to the API as s.",source:"@site/docs/api/simuloobject/simuloobject.mdx",sourceDirName:"api/simuloobject",slug:"/api/simuloobject/",permalink:"/api/simuloobject/",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"apiSidebar",previous:{title:"Input",permalink:"/api/input/"}},o={},r=[{value:"Fields",id:"fields",level:2},{value:"Functions",id:"functions",level:2},{value:":destroy()",id:"destroy",level:3},{value:"Example",id:"example",level:4},{value:":get_position()",id:"get_position",level:3},{value:"Example",id:"example-1",level:4},{value:":set_position(...)",id:"set_position",level:3},{value:"Example",id:"example-2",level:4},{value:":get_angle()",id:"get_angle",level:3},{value:"Example",id:"example-3",level:4},{value:":set_angle(...)",id:"set_angle",level:3},{value:"Example",id:"example-4",level:4},{value:":get_linear_velocity()",id:"get_linear_velocity",level:3},{value:"Example",id:"example-5",level:4},{value:":set_linear_velocity(...)",id:"set_linear_velocity",level:3},{value:"Example",id:"example-6",level:4},{value:":get_angular_velocity()",id:"get_angular_velocity",level:3},{value:"Example",id:"example-7",level:4},{value:":set_angular_velocity(...)",id:"set_angular_velocity",level:3},{value:"Example",id:"example-8",level:4},{value:":apply_force_to_center(...)",id:"apply_force_to_center",level:3},{value:"Example",id:"example-9",level:4},{value:":add_component(...)",id:"add_component",level:3},{value:"Example",id:"example-10",level:4}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",li:"li",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.R)(),...e.components},{Type:l}=n;return l||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Type",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"simuloobject",children:"SimuloObject"}),"\n",(0,s.jsxs)(n.p,{children:["All objects in a Simulo scene, such as boxes, circles, polygons, etc, are known to the API as ",(0,s.jsx)(l,{name:"object"}),"s."]}),"\n",(0,s.jsxs)(n.p,{children:["A ",(0,s.jsx)(l,{name:"object"})," reference is typically obtained by:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Getting it with ",(0,s.jsx)(n.code,{children:"Scene:get_object_by_guid"})]}),"\n",(0,s.jsxs)(n.li,{children:["Getting it with ",(0,s.jsx)(n.code,{children:"Scene:get_all_objects"})]}),"\n",(0,s.jsxs)(n.li,{children:["Using ",(0,s.jsx)(n.code,{children:"self"})," in a ",(0,s.jsx)(n.a,{href:"/api/components/",children:"Component"})," script"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"fields",children:"Fields"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Field"}),(0,s.jsx)(n.th,{children:"Description"}),(0,s.jsx)(n.th,{children:"Note"}),(0,s.jsx)(n.th,{children:"Type"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"guid"})}),(0,s.jsxs)(n.td,{children:["The ",(0,s.jsx)(l,{name:"guid"})," of the object"]}),(0,s.jsx)(n.td,{}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l,{name:"number"})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"color"})}),(0,s.jsxs)(n.td,{children:["The color of the object, like ",(0,s.jsx)(n.code,{children:"0xff0000"})," for red"]}),(0,s.jsx)(n.td,{}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l,{name:"number"})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"name"})}),(0,s.jsx)(n.td,{children:"The name of the object"}),(0,s.jsx)(n.td,{}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l,{name:"string"})})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"functions",children:"Functions"}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["Make sure to use ",(0,s.jsx)(n.code,{children:"object:function()"})," and not ",(0,s.jsx)(n.code,{children:"object.function()"}),", or you'll get an error"]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"destroy",children:":destroy()"}),"\n",(0,s.jsxs)(n.p,{children:["Destroys the object. This will call any ",(0,s.jsx)(n.code,{children:"on_destroy"})," functions of components on the object."]}),"\n",(0,s.jsx)(n.h4,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:"object:destroy();\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"get_position",children:":get_position()"}),"\n",(0,s.jsxs)(n.p,{children:["Returns the position of the object as a ",(0,s.jsx)(l,{name:"vec2"}),"."]}),"\n",(0,s.jsx)(n.h4,{id:"example-1",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:"local pos = object:get_position();\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"set_position",children:":set_position(...)"}),"\n",(0,s.jsxs)(n.p,{children:["Sets the position of the object to a ",(0,s.jsx)(l,{name:"vec2"}),"."]}),"\n",(0,s.jsx)(n.h4,{id:"example-2",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:"object:set_position(vec2(1, 1));\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"get_angle",children:":get_angle()"}),"\n",(0,s.jsxs)(n.p,{children:["Gets the angle of the object as a ",(0,s.jsx)(l,{name:"number"}),". Measured in radians."]}),"\n",(0,s.jsx)(n.h4,{id:"example-3",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:"local angle = object:get_angle();\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"set_angle",children:":set_angle(...)"}),"\n",(0,s.jsxs)(n.p,{children:["Sets the angle of the object to a ",(0,s.jsx)(l,{name:"number"}),". Measured in radians."]}),"\n",(0,s.jsx)(n.h4,{id:"example-4",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:"object:set_angle(math.pi); -- 180 degrees is pi radians\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"get_linear_velocity",children:":get_linear_velocity()"}),"\n",(0,s.jsxs)(n.p,{children:["Returns the linear velocity of the object as a ",(0,s.jsx)(l,{name:"vec2"}),". Measured in meters per second."]}),"\n",(0,s.jsx)(n.h4,{id:"example-5",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:"local linvel = object:get_linear_velocity();\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"set_linear_velocity",children:":set_linear_velocity(...)"}),"\n",(0,s.jsxs)(n.p,{children:["Sets the linear velocity of the object to a ",(0,s.jsx)(l,{name:"vec2"}),". Measured in meters per second."]}),"\n",(0,s.jsxs)(n.p,{children:["Note that this will not behave realistically. You may want to use ",(0,s.jsx)(n.a,{href:"#apply_force_to_center",children:(0,s.jsx)(n.code,{children:":apply_force_to_center"})})," instead."]}),"\n",(0,s.jsx)(n.h4,{id:"example-6",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:"object:set_linear_velocity(vec2(1, 1));\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"get_angular_velocity",children:":get_angular_velocity()"}),"\n",(0,s.jsxs)(n.p,{children:["Gets the angular velocity of the object as a ",(0,s.jsx)(l,{name:"number"}),". Measured in radians per second."]}),"\n",(0,s.jsx)(n.h4,{id:"example-7",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:"local angle = object:get_angle();\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"set_angular_velocity",children:":set_angular_velocity(...)"}),"\n",(0,s.jsxs)(n.p,{children:["Sets the angular velocity of the object to a ",(0,s.jsx)(l,{name:"number"}),". Measured in radians per second."]}),"\n",(0,s.jsx)(n.h4,{id:"example-8",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:"object:set_angular_velocity(0.174533); -- 10 degrees per second\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"apply_force_to_center",children:":apply_force_to_center(...)"}),"\n",(0,s.jsxs)(n.p,{children:["Applies a world force ",(0,s.jsx)(l,{name:"vec2"})," to the center of the object. Measured in newtons (N)."]}),"\n",(0,s.jsx)(n.h4,{id:"example-9",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:"object:apply_force_to_center(vec2(0, 500));\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h3,{id:"add_component",children:":add_component(...)"}),"\n",(0,s.jsxs)(n.p,{children:["Adds a component of a ",(0,s.jsx)(l,{name:"hash"})," to the object."]}),"\n",(0,s.jsx)(n.h4,{id:"example-10",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:"local hash = Scene:add_component(...); -- see component docs\n\nobject:add_component(hash);\n"})})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:(e,n,l)=>{l.d(n,{R:()=>a,x:()=>c});var s=l(6540);const t={},i=s.createContext(t);function a(e){const n=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6a638f41.f88bfe75.js b/assets/js/6a638f41.f88bfe75.js new file mode 100644 index 0000000..d2c0a5d --- /dev/null +++ b/assets/js/6a638f41.f88bfe75.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[506],{8741:(e,n,l)=>{l.r(n),l.d(n,{assets:()=>a,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>o,toc:()=>r});var t=l(4848),s=l(8453);const i={title:"SimuloObject",description:"API documentation for SimuloObjects"},c="SimuloObject",o={id:"api/simuloobject/simuloobject",title:"SimuloObject",description:"API documentation for SimuloObjects",source:"@site/docs/api/simuloobject/simuloobject.mdx",sourceDirName:"api/simuloobject",slug:"/api/simuloobject/",permalink:"/api/simuloobject/",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{title:"SimuloObject",description:"API documentation for SimuloObjects"},sidebar:"apiSidebar",previous:{title:"Input",permalink:"/api/input/"}},a={},r=[{value:"Fields",id:"fields",level:2},{value:"Functions",id:"functions",level:2},{value:":destroy()",id:"destroy",level:3},{value:"Example",id:"example",level:4},{value:":get_position()",id:"get_position",level:3},{value:"Example",id:"example-1",level:4},{value:":set_position(...)",id:"set_position",level:3},{value:"Example",id:"example-2",level:4},{value:":get_angle()",id:"get_angle",level:3},{value:"Example",id:"example-3",level:4},{value:":set_angle(...)",id:"set_angle",level:3},{value:"Example",id:"example-4",level:4},{value:":get_linear_velocity()",id:"get_linear_velocity",level:3},{value:"Example",id:"example-5",level:4},{value:":set_linear_velocity(...)",id:"set_linear_velocity",level:3},{value:"Example",id:"example-6",level:4},{value:":get_angular_velocity()",id:"get_angular_velocity",level:3},{value:"Example",id:"example-7",level:4},{value:":set_angular_velocity(...)",id:"set_angular_velocity",level:3},{value:"Example",id:"example-8",level:4},{value:":apply_force_to_center(...)",id:"apply_force_to_center",level:3},{value:"Example",id:"example-9",level:4},{value:":add_component(...)",id:"add_component",level:3},{value:"Example",id:"example-10",level:4}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",li:"li",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components},{Type:l}=n;return l||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Type",!0),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"simuloobject",children:"SimuloObject"}),"\n",(0,t.jsxs)(n.p,{children:["All objects in a Simulo scene, such as boxes, circles, polygons, etc, are known to the API as ",(0,t.jsx)(l,{name:"object"}),"s."]}),"\n",(0,t.jsxs)(n.p,{children:["A ",(0,t.jsx)(l,{name:"object"})," reference is typically obtained by:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Getting it with ",(0,t.jsx)(n.code,{children:"Scene:get_object_by_guid"})]}),"\n",(0,t.jsxs)(n.li,{children:["Getting it with ",(0,t.jsx)(n.code,{children:"Scene:get_all_objects"})]}),"\n",(0,t.jsxs)(n.li,{children:["Using ",(0,t.jsx)(n.code,{children:"self"})," in a ",(0,t.jsx)(n.a,{href:"/api/components/",children:"Component"})," script"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"fields",children:"Fields"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Field"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Note"}),(0,t.jsx)(n.th,{children:"Type"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"guid"})}),(0,t.jsxs)(n.td,{children:["The ",(0,t.jsx)(l,{name:"guid"})," of the object"]}),(0,t.jsx)(n.td,{}),(0,t.jsx)(n.td,{children:(0,t.jsx)(l,{name:"number"})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"color"})}),(0,t.jsxs)(n.td,{children:["The color of the object, like ",(0,t.jsx)(n.code,{children:"0xff0000"})," for red"]}),(0,t.jsx)(n.td,{}),(0,t.jsx)(n.td,{children:(0,t.jsx)(l,{name:"number"})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"name"})}),(0,t.jsx)(n.td,{children:"The name of the object"}),(0,t.jsx)(n.td,{}),(0,t.jsx)(n.td,{children:(0,t.jsx)(l,{name:"string"})})]})]})]}),"\n",(0,t.jsx)(n.h2,{id:"functions",children:"Functions"}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsxs)(n.p,{children:["Make sure to use ",(0,t.jsx)(n.code,{children:"object:function()"})," and not ",(0,t.jsx)(n.code,{children:"object.function()"}),", or you'll get an error"]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"destroy",children:":destroy()"}),"\n",(0,t.jsxs)(n.p,{children:["Destroys the object. This will call any ",(0,t.jsx)(n.code,{children:"on_destroy"})," functions of components on the object."]}),"\n",(0,t.jsx)(n.h4,{id:"example",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"object:destroy();\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"get_position",children:":get_position()"}),"\n",(0,t.jsxs)(n.p,{children:["Returns the position of the object as a ",(0,t.jsx)(l,{name:"vec2"}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"example-1",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local pos = object:get_position();\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"set_position",children:":set_position(...)"}),"\n",(0,t.jsxs)(n.p,{children:["Sets the position of the object to a ",(0,t.jsx)(l,{name:"vec2"}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"example-2",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"object:set_position(vec2(1, 1));\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"get_angle",children:":get_angle()"}),"\n",(0,t.jsxs)(n.p,{children:["Gets the angle of the object as a ",(0,t.jsx)(l,{name:"number"}),". Measured in radians."]}),"\n",(0,t.jsx)(n.h4,{id:"example-3",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local angle = object:get_angle();\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"set_angle",children:":set_angle(...)"}),"\n",(0,t.jsxs)(n.p,{children:["Sets the angle of the object to a ",(0,t.jsx)(l,{name:"number"}),". Measured in radians."]}),"\n",(0,t.jsx)(n.h4,{id:"example-4",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"object:set_angle(math.pi); -- 180 degrees is pi radians\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"get_linear_velocity",children:":get_linear_velocity()"}),"\n",(0,t.jsxs)(n.p,{children:["Returns the linear velocity of the object as a ",(0,t.jsx)(l,{name:"vec2"}),". Measured in meters per second."]}),"\n",(0,t.jsx)(n.h4,{id:"example-5",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local linvel = object:get_linear_velocity();\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"set_linear_velocity",children:":set_linear_velocity(...)"}),"\n",(0,t.jsxs)(n.p,{children:["Sets the linear velocity of the object to a ",(0,t.jsx)(l,{name:"vec2"}),". Measured in meters per second."]}),"\n",(0,t.jsxs)(n.p,{children:["Note that this will not behave realistically. You may want to use ",(0,t.jsx)(n.a,{href:"#apply_force_to_center",children:(0,t.jsx)(n.code,{children:":apply_force_to_center"})})," instead."]}),"\n",(0,t.jsx)(n.h4,{id:"example-6",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"object:set_linear_velocity(vec2(1, 1));\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"get_angular_velocity",children:":get_angular_velocity()"}),"\n",(0,t.jsxs)(n.p,{children:["Gets the angular velocity of the object as a ",(0,t.jsx)(l,{name:"number"}),". Measured in radians per second."]}),"\n",(0,t.jsx)(n.h4,{id:"example-7",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local angle = object:get_angle();\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"set_angular_velocity",children:":set_angular_velocity(...)"}),"\n",(0,t.jsxs)(n.p,{children:["Sets the angular velocity of the object to a ",(0,t.jsx)(l,{name:"number"}),". Measured in radians per second."]}),"\n",(0,t.jsx)(n.h4,{id:"example-8",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"object:set_angular_velocity(0.174533); -- 10 degrees per second\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"apply_force_to_center",children:":apply_force_to_center(...)"}),"\n",(0,t.jsxs)(n.p,{children:["Applies a world force ",(0,t.jsx)(l,{name:"vec2"})," to the center of the object. Measured in newtons (N)."]}),"\n",(0,t.jsx)(n.h4,{id:"example-9",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"object:apply_force_to_center(vec2(0, 500));\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"add_component",children:":add_component(...)"}),"\n",(0,t.jsxs)(n.p,{children:["Adds a component of a ",(0,t.jsx)(l,{name:"hash"})," to the object."]}),"\n",(0,t.jsx)(n.h4,{id:"example-10",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"local hash = Scene:add_component(...); -- see component docs\n\nobject:add_component(hash);\n"})})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,n,l)=>{l.d(n,{R:()=>c,x:()=>o});var t=l(6540);const s={},i=t.createContext(s);function c(e){const n=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:c(e.components),t.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/70f34273.60538b94.js b/assets/js/70f34273.60538b94.js new file mode 100644 index 0000000..3476799 --- /dev/null +++ b/assets/js/70f34273.60538b94.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[111],{3601:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>r,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>t,toc:()=>o});var l=s(4848),d=s(8453);const i={sidebar_position:2,title:"Scene",description:"The Scene global provides fields and functions relating to the Simulo scene."},c="Scene",t={id:"api/scene/scene",title:"Scene",description:"The Scene global provides fields and functions relating to the Simulo scene.",source:"@site/docs/api/scene/scene.md",sourceDirName:"api/scene",slug:"/api/scene/",permalink:"/api/scene/",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,title:"Scene",description:"The Scene global provides fields and functions relating to the Simulo scene."},sidebar:"apiSidebar",previous:{title:"API Docs Introduction",permalink:"/api/intro"},next:{title:"Vec2",permalink:"/api/vec2"}},r={},o=[{value:"Fields",id:"fields",level:2},{value:"Functions",id:"functions",level:2},{value:"Scene:add_box(...)",id:"sceneadd_box",level:3},{value:"Example",id:"example",level:4},{value:"Table Fields",id:"table-fields",level:4},{value:"Scene:add_circle(...)",id:"sceneadd_circle",level:3},{value:"Example",id:"example-1",level:4},{value:"Table Fields",id:"table-fields-1",level:4},{value:"Scene:add_component(...)",id:"sceneadd_component",level:3},{value:"Example",id:"example-2",level:4},{value:"Table Fields",id:"table-fields-2",level:4},{value:"Scene:add_simulon(...)",id:"sceneadd_simulon",level:3},{value:"Example",id:"example-3",level:4},{value:"Table Fields",id:"table-fields-3",level:4},{value:"Scene:get_object_by_guid(...)",id:"sceneget_object_by_guid",level:3},{value:"Example",id:"example-4",level:4},{value:"Scene:get_all_objects()",id:"sceneget_all_objects",level:3},{value:"Example",id:"example-5",level:4},{value:"Scene:get_gravity()",id:"sceneget_gravity",level:3},{value:"Example",id:"example-6",level:4},{value:"Scene:set_gravity(...)",id:"sceneset_gravity",level:3},{value:"Example",id:"example-7",level:4},{value:"Scene:overlap_circle(...)",id:"sceneoverlap_circle",level:3},{value:"Example",id:"example-8",level:4},{value:"Table Fields",id:"table-fields-4",level:4},{value:"Scene:explode(...)",id:"sceneexplode",level:3},{value:"Example",id:"example-9",level:4},{value:"Table Fields",id:"table-fields-5",level:4}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,d.R)(),...e.components},{Type:s}=n;return s||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Type",!0),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.h1,{id:"scene",children:"Scene"}),"\n",(0,l.jsxs)(n.p,{children:["The ",(0,l.jsx)(n.code,{children:"Scene"})," global provides fields and functions relating to the Simulo scene."]}),"\n",(0,l.jsx)(n.h2,{id:"fields",children:"Fields"}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{children:"Field"}),(0,l.jsx)(n.th,{children:"Description"}),(0,l.jsx)(n.th,{children:"Note"}),(0,l.jsx)(n.th,{children:"Default"}),(0,l.jsx)(n.th,{children:"Type"})]})}),(0,l.jsxs)(n.tbody,{children:[(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"Scene.title"})}),(0,l.jsx)(n.td,{children:"The name of the scene"}),(0,l.jsx)(n.td,{}),(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:'"Untitled Scene"'})}),(0,l.jsx)(n.td,{children:(0,l.jsx)(s,{name:"string"})})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"Scene.background_color"})}),(0,l.jsx)(n.td,{children:"The color shown behind the scene"}),(0,l.jsx)(n.td,{}),(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"0x34213d"})}),(0,l.jsx)(n.td,{children:(0,l.jsx)(s,{name:"number"})})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"Scene.runtime_version"})}),(0,l.jsx)(n.td,{children:"The version of the Simulo Runtime"}),(0,l.jsx)(n.td,{children:"Read-only"}),(0,l.jsx)(n.td,{}),(0,l.jsx)(n.td,{children:(0,l.jsx)(s,{name:"string"})})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"Scene.box2d_version"})}),(0,l.jsx)(n.td,{children:"The version of Box2D used in the Simulo runtime"}),(0,l.jsx)(n.td,{children:"Read-only"}),(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"3.0.0"})}),(0,l.jsx)(n.td,{children:(0,l.jsx)(s,{name:"string"})})]})]})]}),"\n",(0,l.jsx)(n.h2,{id:"functions",children:"Functions"}),"\n",(0,l.jsx)(n.admonition,{type:"note",children:(0,l.jsxs)(n.p,{children:["Make sure to use ",(0,l.jsx)(n.code,{children:"Scene:function()"})," and not ",(0,l.jsx)(n.code,{children:"Scene.function()"}),", or you'll get an error"]})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h3,{id:"sceneadd_box",children:"Scene:add_box(...)"}),"\n",(0,l.jsxs)(n.p,{children:["Adds a new box to the scene. Takes a table as parameter, returns a ",(0,l.jsx)(s,{name:"object"}),"."]}),"\n",(0,l.jsx)(n.h4,{id:"example",children:"Example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-lua",children:"Scene:add_box({\n position = vec2(0, 0),\n size = vec2(1, 1),\n color = 0xe5d3b9,\n is_static = false,\n});\n"})}),"\n",(0,l.jsx)(n.h4,{id:"table-fields",children:"Table Fields"}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{children:"Table Field"}),(0,l.jsx)(n.th,{children:"Description"}),(0,l.jsx)(n.th,{children:"Note"})]})}),(0,l.jsxs)(n.tbody,{children:[(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"position"})," ",(0,l.jsx)(s,{name:"vec2"})]}),(0,l.jsx)(n.td,{children:"Where to spawn the box"}),(0,l.jsx)(n.td,{})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"size"})," ",(0,l.jsx)(s,{name:"vec2"})]}),(0,l.jsx)(n.td,{children:"Size of the box in meters"}),(0,l.jsx)(n.td,{})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"color"})," ",(0,l.jsx)(s,{name:"number"})]}),(0,l.jsxs)(n.td,{children:["Color of the box, like ",(0,l.jsx)(n.code,{children:"0xe5d3b9"})]}),(0,l.jsx)(n.td,{})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"is_static"})," ",(0,l.jsx)(s,{name:"boolean"})]}),(0,l.jsx)(n.td,{children:'Should the box be "glued to the background"?'}),(0,l.jsx)(n.td,{})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"name"})," ",(0,l.jsx)(s,{name:"string"})]}),(0,l.jsxs)(n.td,{children:["What should the name of the box be? Defaults to ",(0,l.jsx)(n.code,{children:'"Box"'})]}),(0,l.jsx)(n.td,{children:"Optional"})]})]})]}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h3,{id:"sceneadd_circle",children:"Scene:add_circle(...)"}),"\n",(0,l.jsxs)(n.p,{children:["Adds a new circle to the scene. Takes a table as parameter, returns a ",(0,l.jsx)(s,{name:"object"}),"."]}),"\n",(0,l.jsx)(n.h4,{id:"example-1",children:"Example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-lua",children:"Scene:add_circle({\n position = vec2(0, 0),\n radius = 1,\n color = 0xe5d3b9,\n is_static = false,\n});\n"})}),"\n",(0,l.jsx)(n.h4,{id:"table-fields-1",children:"Table Fields"}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{children:"Table Field"}),(0,l.jsx)(n.th,{children:"Description"}),(0,l.jsx)(n.th,{children:"Note"})]})}),(0,l.jsxs)(n.tbody,{children:[(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"position"})," ",(0,l.jsx)(s,{name:"vec2"})]}),(0,l.jsx)(n.td,{children:"Where to spawn the circle"}),(0,l.jsx)(n.td,{})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"radius"})," ",(0,l.jsx)(s,{name:"number"})]}),(0,l.jsx)(n.td,{children:"Radius of the circle in meters"}),(0,l.jsx)(n.td,{})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"color"})," ",(0,l.jsx)(s,{name:"number"})]}),(0,l.jsxs)(n.td,{children:["Color of the circle, like ",(0,l.jsx)(n.code,{children:"0xe5d3b9"})]}),(0,l.jsx)(n.td,{})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"is_static"})," ",(0,l.jsx)(s,{name:"boolean"})]}),(0,l.jsx)(n.td,{children:'Should the circle be "glued to the background"?'}),(0,l.jsx)(n.td,{})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"name"})," ",(0,l.jsx)(s,{name:"string"})]}),(0,l.jsxs)(n.td,{children:["What should the name of the circle be? Defaults to ",(0,l.jsx)(n.code,{children:'"Circle"'})]}),(0,l.jsx)(n.td,{children:"Optional"})]})]})]}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h3,{id:"sceneadd_component",children:"Scene:add_component(...)"}),"\n",(0,l.jsxs)(n.p,{children:["Adds a new component to the scene. Takes a table as parameter, returns a ",(0,l.jsx)(s,{name:"hash"}),"."]}),"\n",(0,l.jsxs)(n.p,{children:["For a detailed explanation, check out the ",(0,l.jsx)(n.a,{href:"/api/components/",children:"Components section of the API Docs"}),"."]}),"\n",(0,l.jsx)(n.h4,{id:"example-2",children:"Example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-lua",children:'Scene:add_component({\n name = "My Component",\n version = "0.1.0",\n id = "@john_doe/test/my_component",\n\n -- Lua/Luau code\n code = [[\n function on_start()\n print("Hello, worlds!");\n end;\n ]],\n});\n'})}),"\n",(0,l.jsx)(n.h4,{id:"table-fields-2",children:"Table Fields"}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{children:"Table Field"}),(0,l.jsx)(n.th,{children:"Description"}),(0,l.jsx)(n.th,{children:"Note"})]})}),(0,l.jsxs)(n.tbody,{children:[(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"name"})," ",(0,l.jsx)(s,{name:"string"})]}),(0,l.jsx)(n.td,{children:"Where to spawn the circle"}),(0,l.jsx)(n.td,{})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"version"})," ",(0,l.jsx)(s,{name:"string"})]}),(0,l.jsxs)(n.td,{children:["Component metadata version, defaults to ",(0,l.jsx)(n.code,{children:'"0.1.0"'})]}),(0,l.jsx)(n.td,{children:"Optional"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"id"})," ",(0,l.jsx)(s,{name:"string"})]}),(0,l.jsxs)(n.td,{children:["Unique ID for your component, should be something like ",(0,l.jsx)(n.code,{children:'"@yourname/projectname/componentname"'})]}),(0,l.jsx)(n.td,{})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"code"})," ",(0,l.jsx)(s,{name:"string"})]}),(0,l.jsx)(n.td,{children:"Luau script for the component"}),(0,l.jsx)(n.td,{})]})]})]}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h3,{id:"sceneadd_simulon",children:"Scene:add_simulon(...)"}),"\n",(0,l.jsx)(n.p,{children:"Adds a simulon to the scene, Simulo's mascot. Returns nothing."}),"\n",(0,l.jsx)(n.p,{children:"This function may be removed by public release, where users will instead be able to spawn simulons just like any other saved object."}),"\n",(0,l.jsx)(n.h4,{id:"example-3",children:"Example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-lua",children:"Scene:add_simulon({\n position = vec2(0, 0),\n density = 1,\n color = 0xff0000,\n});\n"})}),"\n",(0,l.jsx)(n.h4,{id:"table-fields-3",children:"Table Fields"}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{children:"Table Field"}),(0,l.jsx)(n.th,{children:"Description"}),(0,l.jsx)(n.th,{children:"Note"})]})}),(0,l.jsxs)(n.tbody,{children:[(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"position"})," ",(0,l.jsx)(s,{name:"vec2"})]}),(0,l.jsx)(n.td,{children:"Where to spawn the simulon"}),(0,l.jsx)(n.td,{})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"density"})," ",(0,l.jsx)(s,{name:"number"})]}),(0,l.jsx)(n.td,{children:"Density for the simulon"}),(0,l.jsx)(n.td,{})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"color"})," ",(0,l.jsx)(s,{name:"number"})]}),(0,l.jsxs)(n.td,{children:["Simulon color, defaults to ",(0,l.jsx)(n.code,{children:"0xa9bc67"})]}),(0,l.jsx)(n.td,{children:"Optional"})]})]})]}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h3,{id:"sceneget_object_by_guid",children:"Scene:get_object_by_guid(...)"}),"\n",(0,l.jsxs)(n.p,{children:["Returns the ",(0,l.jsx)(s,{name:"object"})," of the given ",(0,l.jsx)(s,{name:"guid"}),", or ",(0,l.jsx)(s,{name:"nil"})," if it doesn't exist."]}),"\n",(0,l.jsx)(n.h4,{id:"example-4",children:"Example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-lua",children:"local object = Scene:get_object_by_guid(20);\n"})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h3,{id:"sceneget_all_objects",children:"Scene:get_all_objects()"}),"\n",(0,l.jsxs)(n.p,{children:["Returns a ",(0,l.jsx)(s,{name:"table"})," which is a list of ",(0,l.jsx)(s,{name:"object"}),"s."]}),"\n",(0,l.jsx)(n.h4,{id:"example-5",children:"Example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-lua",children:"local objects = Scene:get_all_objects();\n\n-- Destroy all objects in scene\nfor i=1,#objects do\n objs[i]:destroy();\nend;\n"})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h3,{id:"sceneget_gravity",children:"Scene:get_gravity()"}),"\n",(0,l.jsxs)(n.p,{children:["Returns a ",(0,l.jsx)(s,{name:"vec2"})," of the scene's gravity."]}),"\n",(0,l.jsx)(n.h4,{id:"example-6",children:"Example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-lua",children:"local gravity = Scene:get_gravity();\n\nprint(tostring(gravity));\n"})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h3,{id:"sceneset_gravity",children:"Scene:set_gravity(...)"}),"\n",(0,l.jsxs)(n.p,{children:["Sets the scene's gravity to a ",(0,l.jsx)(s,{name:"vec2"}),". Returns nothing."]}),"\n",(0,l.jsx)(n.h4,{id:"example-7",children:"Example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-lua",children:"Scene:set_gravity(vec2(0, -15));\n"})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h3,{id:"sceneoverlap_circle",children:"Scene:overlap_circle(...)"}),"\n",(0,l.jsxs)(n.p,{children:["Returns a ",(0,l.jsx)(s,{name:"table"})," which is a list of ",(0,l.jsx)(s,{name:"object"}),"s that overlap with a circle. Does not actually create any circle shape."]}),"\n",(0,l.jsx)(n.h4,{id:"example-8",children:"Example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-lua",children:'local objects_in_circle = Scene:overlap_circle({\n position = vec2(0, 0),\n radius = 10,\n});\n\n-- Print the GUIDs\nfor i=1,#objects do\n print("Object of GUID " .. tostring(objs[i].guid) .. " was in circle");\nend;\n'})}),"\n",(0,l.jsx)(n.h4,{id:"table-fields-4",children:"Table Fields"}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{children:"Table Field"}),(0,l.jsx)(n.th,{children:"Description"}),(0,l.jsx)(n.th,{children:"Note"})]})}),(0,l.jsxs)(n.tbody,{children:[(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"position"})," ",(0,l.jsx)(s,{name:"vec2"})]}),(0,l.jsx)(n.td,{children:"Center of the circle"}),(0,l.jsx)(n.td,{})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"radius"})," ",(0,l.jsx)(s,{name:"number"})]}),(0,l.jsx)(n.td,{children:"Radius of the circle"}),(0,l.jsx)(n.td,{})]})]})]}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h3,{id:"sceneexplode",children:"Scene:explode(...)"}),"\n",(0,l.jsx)(n.p,{children:"Applies an impulse in the scene at a given point to all objects in its radius."}),"\n",(0,l.jsx)(n.admonition,{type:"note",children:(0,l.jsx)(n.p,{children:"The explosion impulse does not depend on distance, all objects in the radius will get the same impulse."})}),"\n",(0,l.jsx)(n.h4,{id:"example-9",children:"Example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-lua",children:"Scene:explode({\n position = vec2(0, 0),\n radius = 10,\n impulse = 10.\n});\n"})}),"\n",(0,l.jsx)(n.h4,{id:"table-fields-5",children:"Table Fields"}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{children:"Table Field"}),(0,l.jsx)(n.th,{children:"Description"}),(0,l.jsx)(n.th,{children:"Note"})]})}),(0,l.jsxs)(n.tbody,{children:[(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"position"})," ",(0,l.jsx)(s,{name:"vec2"})]}),(0,l.jsx)(n.td,{children:"Center of the explosion"}),(0,l.jsx)(n.td,{})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"radius"})," ",(0,l.jsx)(s,{name:"number"})]}),(0,l.jsx)(n.td,{children:"Radius of the explosion"}),(0,l.jsx)(n.td,{})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"impulse"})," ",(0,l.jsx)(s,{name:"number"})]}),(0,l.jsx)(n.td,{children:"Impulse of the explosion"}),(0,l.jsx)(n.td,{})]})]})]})]})}function h(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(a,{...e})}):a(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>c,x:()=>t});var l=s(6540);const d={},i=l.createContext(d);function c(e){const n=l.useContext(i);return l.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function t(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(d):e.components||d:c(e.components),l.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/70f34273.8dbbe154.js b/assets/js/70f34273.8dbbe154.js deleted file mode 100644 index 4b06408..0000000 --- a/assets/js/70f34273.8dbbe154.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[111],{3601:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>r,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>t,toc:()=>a});var d=s(4848),l=s(8453);const i={sidebar_position:2},c="Scene",t={id:"api/scene/scene",title:"Scene",description:"The Scene global provides fields and functions relating to the Simulo scene.",source:"@site/docs/api/scene/scene.md",sourceDirName:"api/scene",slug:"/api/scene/",permalink:"/api/scene/",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"apiSidebar",previous:{title:"API Docs Introduction",permalink:"/api/intro"},next:{title:"Vec2",permalink:"/api/vec2"}},r={},a=[{value:"Fields",id:"fields",level:2},{value:"Functions",id:"functions",level:2},{value:"Scene:add_box(...)",id:"sceneadd_box",level:3},{value:"Example",id:"example",level:4},{value:"Table Fields",id:"table-fields",level:4},{value:"Scene:add_circle(...)",id:"sceneadd_circle",level:3},{value:"Example",id:"example-1",level:4},{value:"Table Fields",id:"table-fields-1",level:4},{value:"Scene:add_component(...)",id:"sceneadd_component",level:3},{value:"Example",id:"example-2",level:4},{value:"Table Fields",id:"table-fields-2",level:4},{value:"Scene:add_simulon(...)",id:"sceneadd_simulon",level:3},{value:"Example",id:"example-3",level:4},{value:"Table Fields",id:"table-fields-3",level:4},{value:"Scene:get_object_by_guid(...)",id:"sceneget_object_by_guid",level:3},{value:"Example",id:"example-4",level:4},{value:"Scene:get_all_objects()",id:"sceneget_all_objects",level:3},{value:"Example",id:"example-5",level:4},{value:"Scene:get_gravity()",id:"sceneget_gravity",level:3},{value:"Example",id:"example-6",level:4},{value:"Scene:set_gravity(...)",id:"sceneset_gravity",level:3},{value:"Example",id:"example-7",level:4},{value:"Scene:overlap_circle(...)",id:"sceneoverlap_circle",level:3},{value:"Example",id:"example-8",level:4},{value:"Table Fields",id:"table-fields-4",level:4},{value:"Scene:explode(...)",id:"sceneexplode",level:3},{value:"Example",id:"example-9",level:4},{value:"Table Fields",id:"table-fields-5",level:4}];function o(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,l.R)(),...e.components},{Type:s}=n;return s||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Type",!0),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.h1,{id:"scene",children:"Scene"}),"\n",(0,d.jsxs)(n.p,{children:["The ",(0,d.jsx)(n.code,{children:"Scene"})," global provides fields and functions relating to the Simulo scene."]}),"\n",(0,d.jsx)(n.h2,{id:"fields",children:"Fields"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Field"}),(0,d.jsx)(n.th,{children:"Description"}),(0,d.jsx)(n.th,{children:"Note"}),(0,d.jsx)(n.th,{children:"Default"}),(0,d.jsx)(n.th,{children:"Type"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"Scene.title"})}),(0,d.jsx)(n.td,{children:"The name of the scene"}),(0,d.jsx)(n.td,{}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:'"Untitled Scene"'})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(s,{name:"string"})})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"Scene.background_color"})}),(0,d.jsx)(n.td,{children:"The color shown behind the scene"}),(0,d.jsx)(n.td,{}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"0x34213d"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(s,{name:"number"})})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"Scene.runtime_version"})}),(0,d.jsx)(n.td,{children:"The version of the Simulo Runtime"}),(0,d.jsx)(n.td,{children:"Read-only"}),(0,d.jsx)(n.td,{}),(0,d.jsx)(n.td,{children:(0,d.jsx)(s,{name:"string"})})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"Scene.box2d_version"})}),(0,d.jsx)(n.td,{children:"The version of Box2D used in the Simulo runtime"}),(0,d.jsx)(n.td,{children:"Read-only"}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"3.0.0"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(s,{name:"string"})})]})]})]}),"\n",(0,d.jsx)(n.h2,{id:"functions",children:"Functions"}),"\n",(0,d.jsx)(n.admonition,{type:"note",children:(0,d.jsxs)(n.p,{children:["Make sure to use ",(0,d.jsx)(n.code,{children:"Scene:function()"})," and not ",(0,d.jsx)(n.code,{children:"Scene.function()"}),", or you'll get an error"]})}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"sceneadd_box",children:"Scene:add_box(...)"}),"\n",(0,d.jsxs)(n.p,{children:["Adds a new box to the scene. Takes a table as parameter, returns a ",(0,d.jsx)(s,{name:"object"}),"."]}),"\n",(0,d.jsx)(n.h4,{id:"example",children:"Example"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"Scene:add_box({\n position = vec2(0, 0),\n size = vec2(1, 1),\n color = 0xe5d3b9,\n is_static = false,\n});\n"})}),"\n",(0,d.jsx)(n.h4,{id:"table-fields",children:"Table Fields"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Table Field"}),(0,d.jsx)(n.th,{children:"Description"}),(0,d.jsx)(n.th,{children:"Note"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"position"})," ",(0,d.jsx)(s,{name:"vec2"})]}),(0,d.jsx)(n.td,{children:"Where to spawn the box"}),(0,d.jsx)(n.td,{})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"size"})," ",(0,d.jsx)(s,{name:"vec2"})]}),(0,d.jsx)(n.td,{children:"Size of the box in meters"}),(0,d.jsx)(n.td,{})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"color"})," ",(0,d.jsx)(s,{name:"number"})]}),(0,d.jsxs)(n.td,{children:["Color of the box, like ",(0,d.jsx)(n.code,{children:"0xe5d3b9"})]}),(0,d.jsx)(n.td,{})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"is_static"})," ",(0,d.jsx)(s,{name:"boolean"})]}),(0,d.jsx)(n.td,{children:'Should the box be "glued to the background"?'}),(0,d.jsx)(n.td,{})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"name"})," ",(0,d.jsx)(s,{name:"string"})]}),(0,d.jsxs)(n.td,{children:["What should the name of the box be? Defaults to ",(0,d.jsx)(n.code,{children:'"Box"'})]}),(0,d.jsx)(n.td,{children:"Optional"})]})]})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"sceneadd_circle",children:"Scene:add_circle(...)"}),"\n",(0,d.jsxs)(n.p,{children:["Adds a new circle to the scene. Takes a table as parameter, returns a ",(0,d.jsx)(s,{name:"object"}),"."]}),"\n",(0,d.jsx)(n.h4,{id:"example-1",children:"Example"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"Scene:add_circle({\n position = vec2(0, 0),\n radius = 1,\n color = 0xe5d3b9,\n is_static = false,\n});\n"})}),"\n",(0,d.jsx)(n.h4,{id:"table-fields-1",children:"Table Fields"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Table Field"}),(0,d.jsx)(n.th,{children:"Description"}),(0,d.jsx)(n.th,{children:"Note"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"position"})," ",(0,d.jsx)(s,{name:"vec2"})]}),(0,d.jsx)(n.td,{children:"Where to spawn the circle"}),(0,d.jsx)(n.td,{})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"radius"})," ",(0,d.jsx)(s,{name:"number"})]}),(0,d.jsx)(n.td,{children:"Radius of the circle in meters"}),(0,d.jsx)(n.td,{})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"color"})," ",(0,d.jsx)(s,{name:"number"})]}),(0,d.jsxs)(n.td,{children:["Color of the circle, like ",(0,d.jsx)(n.code,{children:"0xe5d3b9"})]}),(0,d.jsx)(n.td,{})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"is_static"})," ",(0,d.jsx)(s,{name:"boolean"})]}),(0,d.jsx)(n.td,{children:'Should the circle be "glued to the background"?'}),(0,d.jsx)(n.td,{})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"name"})," ",(0,d.jsx)(s,{name:"string"})]}),(0,d.jsxs)(n.td,{children:["What should the name of the circle be? Defaults to ",(0,d.jsx)(n.code,{children:'"Circle"'})]}),(0,d.jsx)(n.td,{children:"Optional"})]})]})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"sceneadd_component",children:"Scene:add_component(...)"}),"\n",(0,d.jsxs)(n.p,{children:["Adds a new component to the scene. Takes a table as parameter, returns a ",(0,d.jsx)(s,{name:"hash"}),"."]}),"\n",(0,d.jsxs)(n.p,{children:["For a detailed explanation, check out the ",(0,d.jsx)(n.a,{href:"/api/components/",children:"Components section of the API Docs"}),"."]}),"\n",(0,d.jsx)(n.h4,{id:"example-2",children:"Example"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:'Scene:add_component({\n name = "My Component",\n version = "0.1.0",\n id = "@john_doe/test/my_component",\n\n -- Lua/Luau code\n code = [[\n function on_start()\n print("Hello, worlds!");\n end;\n ]],\n});\n'})}),"\n",(0,d.jsx)(n.h4,{id:"table-fields-2",children:"Table Fields"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Table Field"}),(0,d.jsx)(n.th,{children:"Description"}),(0,d.jsx)(n.th,{children:"Note"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"name"})," ",(0,d.jsx)(s,{name:"string"})]}),(0,d.jsx)(n.td,{children:"Where to spawn the circle"}),(0,d.jsx)(n.td,{})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"version"})," ",(0,d.jsx)(s,{name:"string"})]}),(0,d.jsxs)(n.td,{children:["Component metadata version, defaults to ",(0,d.jsx)(n.code,{children:'"0.1.0"'})]}),(0,d.jsx)(n.td,{children:"Optional"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"id"})," ",(0,d.jsx)(s,{name:"string"})]}),(0,d.jsxs)(n.td,{children:["Unique ID for your component, should be something like ",(0,d.jsx)(n.code,{children:'"@yourname/projectname/componentname"'})]}),(0,d.jsx)(n.td,{})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"code"})," ",(0,d.jsx)(s,{name:"string"})]}),(0,d.jsx)(n.td,{children:"Luau script for the component"}),(0,d.jsx)(n.td,{})]})]})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"sceneadd_simulon",children:"Scene:add_simulon(...)"}),"\n",(0,d.jsx)(n.p,{children:"Adds a simulon to the scene, Simulo's mascot. Returns nothing."}),"\n",(0,d.jsx)(n.p,{children:"This function may be removed by public release, where users will instead be able to spawn simulons just like any other saved object."}),"\n",(0,d.jsx)(n.h4,{id:"example-3",children:"Example"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"Scene:add_simulon({\n position = vec2(0, 0),\n density = 1,\n color = 0xff0000,\n});\n"})}),"\n",(0,d.jsx)(n.h4,{id:"table-fields-3",children:"Table Fields"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Table Field"}),(0,d.jsx)(n.th,{children:"Description"}),(0,d.jsx)(n.th,{children:"Note"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"position"})," ",(0,d.jsx)(s,{name:"vec2"})]}),(0,d.jsx)(n.td,{children:"Where to spawn the simulon"}),(0,d.jsx)(n.td,{})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"density"})," ",(0,d.jsx)(s,{name:"number"})]}),(0,d.jsx)(n.td,{children:"Density for the simulon"}),(0,d.jsx)(n.td,{})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"color"})," ",(0,d.jsx)(s,{name:"number"})]}),(0,d.jsxs)(n.td,{children:["Simulon color, defaults to ",(0,d.jsx)(n.code,{children:"0xa9bc67"})]}),(0,d.jsx)(n.td,{children:"Optional"})]})]})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"sceneget_object_by_guid",children:"Scene:get_object_by_guid(...)"}),"\n",(0,d.jsxs)(n.p,{children:["Returns the ",(0,d.jsx)(s,{name:"object"})," of the given ",(0,d.jsx)(s,{name:"guid"}),", or ",(0,d.jsx)(s,{name:"nil"})," if it doesn't exist."]}),"\n",(0,d.jsx)(n.h4,{id:"example-4",children:"Example"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"local object = Scene:get_object_by_guid(20);\n"})}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"sceneget_all_objects",children:"Scene:get_all_objects()"}),"\n",(0,d.jsxs)(n.p,{children:["Returns a ",(0,d.jsx)(s,{name:"table"})," which is a list of ",(0,d.jsx)(s,{name:"object"}),"s."]}),"\n",(0,d.jsx)(n.h4,{id:"example-5",children:"Example"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"local objects = Scene:get_all_objects();\n\n-- Destroy all objects in scene\nfor i=1,#objects do\n objs[i]:destroy();\nend;\n"})}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"sceneget_gravity",children:"Scene:get_gravity()"}),"\n",(0,d.jsxs)(n.p,{children:["Returns a ",(0,d.jsx)(s,{name:"vec2"})," of the scene's gravity."]}),"\n",(0,d.jsx)(n.h4,{id:"example-6",children:"Example"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"local gravity = Scene:get_gravity();\n\nprint(tostring(gravity));\n"})}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"sceneset_gravity",children:"Scene:set_gravity(...)"}),"\n",(0,d.jsxs)(n.p,{children:["Sets the scene's gravity to a ",(0,d.jsx)(s,{name:"vec2"}),". Returns nothing."]}),"\n",(0,d.jsx)(n.h4,{id:"example-7",children:"Example"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"Scene:set_gravity(vec2(0, -15));\n"})}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"sceneoverlap_circle",children:"Scene:overlap_circle(...)"}),"\n",(0,d.jsxs)(n.p,{children:["Returns a ",(0,d.jsx)(s,{name:"table"})," which is a list of ",(0,d.jsx)(s,{name:"object"}),"s that overlap with a circle. Does not actually create any circle shape."]}),"\n",(0,d.jsx)(n.h4,{id:"example-8",children:"Example"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:'local objects_in_circle = Scene:overlap_circle({\n position = vec2(0, 0),\n radius = 10,\n});\n\n-- Print the GUIDs\nfor i=1,#objects do\n print("Object of GUID " .. tostring(objs[i].guid) .. " was in circle");\nend;\n'})}),"\n",(0,d.jsx)(n.h4,{id:"table-fields-4",children:"Table Fields"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Table Field"}),(0,d.jsx)(n.th,{children:"Description"}),(0,d.jsx)(n.th,{children:"Note"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"position"})," ",(0,d.jsx)(s,{name:"vec2"})]}),(0,d.jsx)(n.td,{children:"Center of the circle"}),(0,d.jsx)(n.td,{})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"radius"})," ",(0,d.jsx)(s,{name:"number"})]}),(0,d.jsx)(n.td,{children:"Radius of the circle"}),(0,d.jsx)(n.td,{})]})]})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"sceneexplode",children:"Scene:explode(...)"}),"\n",(0,d.jsx)(n.p,{children:"Applies an impulse in the scene at a given point to all objects in its radius."}),"\n",(0,d.jsx)(n.admonition,{type:"note",children:(0,d.jsx)(n.p,{children:"The explosion impulse does not depend on distance, all objects in the radius will get the same impulse."})}),"\n",(0,d.jsx)(n.h4,{id:"example-9",children:"Example"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"Scene:explode({\n position = vec2(0, 0),\n radius = 10,\n impulse = 10.\n});\n"})}),"\n",(0,d.jsx)(n.h4,{id:"table-fields-5",children:"Table Fields"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Table Field"}),(0,d.jsx)(n.th,{children:"Description"}),(0,d.jsx)(n.th,{children:"Note"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"position"})," ",(0,d.jsx)(s,{name:"vec2"})]}),(0,d.jsx)(n.td,{children:"Center of the explosion"}),(0,d.jsx)(n.td,{})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"radius"})," ",(0,d.jsx)(s,{name:"number"})]}),(0,d.jsx)(n.td,{children:"Radius of the explosion"}),(0,d.jsx)(n.td,{})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.code,{children:"impulse"})," ",(0,d.jsx)(s,{name:"number"})]}),(0,d.jsx)(n.td,{children:"Impulse of the explosion"}),(0,d.jsx)(n.td,{})]})]})]})]})}function h(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,d.jsx)(n,{...e,children:(0,d.jsx)(o,{...e})}):o(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>c,x:()=>t});var d=s(6540);const l={},i=d.createContext(l);function c(e){const n=d.useContext(i);return d.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function t(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:c(e.components),d.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d4f3c2d4.96e47e9f.js b/assets/js/d4f3c2d4.96e47e9f.js new file mode 100644 index 0000000..4fd700b --- /dev/null +++ b/assets/js/d4f3c2d4.96e47e9f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[317],{9927:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>p,contentTitle:()=>r,default:()=>m,frontMatter:()=>i,metadata:()=>c,toc:()=>a});var n=s(4848),o=s(8453);const i={sidebar_position:1,title:"Samples",description:"Various samples of scripts with the Simulo Scripting API"},r="Samples",c={id:"samples/intro",title:"Samples",description:"Various samples of scripts with the Simulo Scripting API",source:"@site/docs/samples/intro.md",sourceDirName:"samples",slug:"/samples/intro",permalink:"/samples/intro",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,title:"Samples",description:"Various samples of scripts with the Simulo Scripting API"},sidebar:"samplesSidebar",next:{title:"Components",permalink:"/category/components"}},p={},a=[];function l(e){const t={h1:"h1",p:"p",...(0,o.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"samples",children:"Samples"}),"\n",(0,n.jsx)(t.p,{children:"Welcome to the Simulo samples, here we have some examples of Script Box scripts and Component scripts, etc."})]})}function m(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(l,{...e})}):l(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>r,x:()=>c});var n=s(6540);const o={},i=n.createContext(o);function r(e){const t=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),n.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d4f3c2d4.a5995dc8.js b/assets/js/d4f3c2d4.a5995dc8.js deleted file mode 100644 index 66e8969..0000000 --- a/assets/js/d4f3c2d4.a5995dc8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[317],{9927:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>a,contentTitle:()=>i,default:()=>l,frontMatter:()=>r,metadata:()=>c,toc:()=>p});var n=s(4848),o=s(8453);const r={sidebar_position:1},i="Samples",c={id:"samples/intro",title:"Samples",description:"Welcome to the Simulo samples, here we have some examples of Script Box scripts and Component scripts, etc.",source:"@site/docs/samples/intro.md",sourceDirName:"samples",slug:"/samples/intro",permalink:"/samples/intro",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"samplesSidebar",next:{title:"Components",permalink:"/category/components"}},a={},p=[];function m(e){const t={h1:"h1",p:"p",...(0,o.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"samples",children:"Samples"}),"\n",(0,n.jsx)(t.p,{children:"Welcome to the Simulo samples, here we have some examples of Script Box scripts and Component scripts, etc."})]})}function l(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(m,{...e})}):m(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>i,x:()=>c});var n=s(6540);const o={},r=n.createContext(o);function i(e){const t=n.useContext(r);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),n.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d70d3333.4b047533.js b/assets/js/d70d3333.4b047533.js deleted file mode 100644 index 127d7c4..0000000 --- a/assets/js/d70d3333.4b047533.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[524],{1876:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>r,default:()=>x,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var s=t(4848),c=t(8453);const i={sidebar_position:4},r="Vec2",d={id:"api/vec2",title:"Vec2",description:"is Simulo's built-in type for 2D vectors.",source:"@site/docs/api/vec2.mdx",sourceDirName:"api",slug:"/api/vec2",permalink:"/api/vec2",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"apiSidebar",previous:{title:"Scene",permalink:"/api/scene/"},next:{title:"Components",permalink:"/api/components/"}},o={},l=[{value:"Constructor",id:"constructor",level:2},{value:"Fields",id:"fields",level:2},{value:"Arithmetic",id:"arithmetic",level:2},{value:"Functions",id:"functions",level:2}];function h(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,c.R)(),...e.components},{Type:t}=n;return t||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Type",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"vec2",children:"Vec2"}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(t,{name:"vec2"})," is Simulo's built-in type for 2D vectors."]}),"\n",(0,s.jsx)(n.h2,{id:"constructor",children:"Constructor"}),"\n",(0,s.jsxs)(n.p,{children:["To create a ",(0,s.jsx)(t,{name:"vec2"}),", use the global ",(0,s.jsx)(n.code,{children:"vec2(x, y)"})," function:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:"local vec = vec2(5, 5);\n"})}),"\n",(0,s.jsx)(n.h2,{id:"fields",children:"Fields"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Field"}),(0,s.jsx)(n.th,{children:"Description"}),(0,s.jsx)(n.th,{children:"Type"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"x"})}),(0,s.jsxs)(n.td,{children:["The ",(0,s.jsx)(n.code,{children:"x"})," component of the ",(0,s.jsx)(t,{name:"vec2"})]}),(0,s.jsx)(n.td,{children:(0,s.jsx)(t,{name:"number"})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"y"})}),(0,s.jsxs)(n.td,{children:["The ",(0,s.jsx)(n.code,{children:"y"})," component of the ",(0,s.jsx)(t,{name:"vec2"})]}),(0,s.jsx)(n.td,{children:(0,s.jsx)(t,{name:"number"})})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"arithmetic",children:"Arithmetic"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Operator"}),(0,s.jsx)(n.th,{children:"Description"}),(0,s.jsx)(n.th,{children:"Return"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(t,{name:"vec2"})," + ",(0,s.jsx)(t,{name:"vec2"})]}),(0,s.jsxs)(n.td,{children:["Returns a new ",(0,s.jsx)(t,{name:"vec2"})," that is the sum of both"]}),(0,s.jsx)(n.td,{children:(0,s.jsx)(t,{name:"vec2"})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(t,{name:"vec2"})," \u2212 ",(0,s.jsx)(t,{name:"vec2"})]}),(0,s.jsx)(n.td,{children:"Returns the difference between both"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(t,{name:"vec2"})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(t,{name:"vec2"})," * ",(0,s.jsx)(t,{name:"number"})]}),(0,s.jsxs)(n.td,{children:["Returns the ",(0,s.jsx)(t,{name:"vec2"})," with each component multiplied by the ",(0,s.jsx)(t,{name:"number"})]}),(0,s.jsx)(n.td,{children:(0,s.jsx)(t,{name:"vec2"})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(t,{name:"vec2"})," / ",(0,s.jsx)(t,{name:"number"})]}),(0,s.jsxs)(n.td,{children:["Returns the ",(0,s.jsx)(t,{name:"vec2"})," with each component divided by the ",(0,s.jsx)(t,{name:"number"})]}),(0,s.jsx)(n.td,{children:(0,s.jsx)(t,{name:"vec2"})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:["\u2212",(0,s.jsx)(t,{name:"vec2"})]}),(0,s.jsxs)(n.td,{children:["Returns the negation of the ",(0,s.jsx)(t,{name:"vec2"})]}),(0,s.jsx)(n.td,{children:(0,s.jsx)(t,{name:"vec2"})})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"functions",children:"Functions"}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["Make sure to use ",(0,s.jsx)(n.code,{children:"vec:function()"})," and not ",(0,s.jsx)(n.code,{children:"vec.function()"}),", or you'll get an error"]})}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Function"}),(0,s.jsx)(n.th,{children:"Description"}),(0,s.jsx)(n.th,{children:"Return"})]})}),(0,s.jsx)(n.tbody,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:":magnitude()"})}),(0,s.jsxs)(n.td,{children:["Returns the length of the ",(0,s.jsx)(t,{name:"vec2"})]}),(0,s.jsx)(n.td,{children:(0,s.jsx)(t,{name:"number"})})]})})]})]})}function x(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>d});var s=t(6540);const c={},i=s.createContext(c);function r(e){const n=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:r(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d70d3333.c91612dc.js b/assets/js/d70d3333.c91612dc.js new file mode 100644 index 0000000..d7e8082 --- /dev/null +++ b/assets/js/d70d3333.c91612dc.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[524],{1876:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>r,default:()=>x,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var s=t(4848),c=t(8453);const i={sidebar_position:4,title:"Vec2",description:"Vec2 is Simulo's built-in type for 2D vectors."},r="Vec2",d={id:"api/vec2",title:"Vec2",description:"Vec2 is Simulo's built-in type for 2D vectors.",source:"@site/docs/api/vec2.mdx",sourceDirName:"api",slug:"/api/vec2",permalink:"/api/vec2",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4,title:"Vec2",description:"Vec2 is Simulo's built-in type for 2D vectors."},sidebar:"apiSidebar",previous:{title:"Scene",permalink:"/api/scene/"},next:{title:"Components",permalink:"/api/components/"}},o={},l=[{value:"Constructor",id:"constructor",level:2},{value:"Fields",id:"fields",level:2},{value:"Arithmetic",id:"arithmetic",level:2},{value:"Functions",id:"functions",level:2}];function h(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,c.R)(),...e.components},{Type:t}=n;return t||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Type",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"vec2",children:"Vec2"}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(t,{name:"vec2"})," is Simulo's built-in type for 2D vectors."]}),"\n",(0,s.jsx)(n.h2,{id:"constructor",children:"Constructor"}),"\n",(0,s.jsxs)(n.p,{children:["To create a ",(0,s.jsx)(t,{name:"vec2"}),", use the global ",(0,s.jsx)(n.code,{children:"vec2(x, y)"})," function:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:"local vec = vec2(5, 5);\n"})}),"\n",(0,s.jsx)(n.h2,{id:"fields",children:"Fields"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Field"}),(0,s.jsx)(n.th,{children:"Description"}),(0,s.jsx)(n.th,{children:"Type"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"x"})}),(0,s.jsxs)(n.td,{children:["The ",(0,s.jsx)(n.code,{children:"x"})," component of the ",(0,s.jsx)(t,{name:"vec2"})]}),(0,s.jsx)(n.td,{children:(0,s.jsx)(t,{name:"number"})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"y"})}),(0,s.jsxs)(n.td,{children:["The ",(0,s.jsx)(n.code,{children:"y"})," component of the ",(0,s.jsx)(t,{name:"vec2"})]}),(0,s.jsx)(n.td,{children:(0,s.jsx)(t,{name:"number"})})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"arithmetic",children:"Arithmetic"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Operator"}),(0,s.jsx)(n.th,{children:"Description"}),(0,s.jsx)(n.th,{children:"Return"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(t,{name:"vec2"})," + ",(0,s.jsx)(t,{name:"vec2"})]}),(0,s.jsxs)(n.td,{children:["Returns a new ",(0,s.jsx)(t,{name:"vec2"})," that is the sum of both"]}),(0,s.jsx)(n.td,{children:(0,s.jsx)(t,{name:"vec2"})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(t,{name:"vec2"})," \u2212 ",(0,s.jsx)(t,{name:"vec2"})]}),(0,s.jsx)(n.td,{children:"Returns the difference between both"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(t,{name:"vec2"})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(t,{name:"vec2"})," * ",(0,s.jsx)(t,{name:"number"})]}),(0,s.jsxs)(n.td,{children:["Returns the ",(0,s.jsx)(t,{name:"vec2"})," with each component multiplied by the ",(0,s.jsx)(t,{name:"number"})]}),(0,s.jsx)(n.td,{children:(0,s.jsx)(t,{name:"vec2"})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(t,{name:"vec2"})," / ",(0,s.jsx)(t,{name:"number"})]}),(0,s.jsxs)(n.td,{children:["Returns the ",(0,s.jsx)(t,{name:"vec2"})," with each component divided by the ",(0,s.jsx)(t,{name:"number"})]}),(0,s.jsx)(n.td,{children:(0,s.jsx)(t,{name:"vec2"})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:["\u2212",(0,s.jsx)(t,{name:"vec2"})]}),(0,s.jsxs)(n.td,{children:["Returns the negation of the ",(0,s.jsx)(t,{name:"vec2"})]}),(0,s.jsx)(n.td,{children:(0,s.jsx)(t,{name:"vec2"})})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"functions",children:"Functions"}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["Make sure to use ",(0,s.jsx)(n.code,{children:"vec:function()"})," and not ",(0,s.jsx)(n.code,{children:"vec.function()"}),", or you'll get an error"]})}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Function"}),(0,s.jsx)(n.th,{children:"Description"}),(0,s.jsx)(n.th,{children:"Return"})]})}),(0,s.jsx)(n.tbody,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:":magnitude()"})}),(0,s.jsxs)(n.td,{children:["Returns the length of the ",(0,s.jsx)(t,{name:"vec2"})]}),(0,s.jsx)(n.td,{children:(0,s.jsx)(t,{name:"number"})})]})})]})]})}function x(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>d});var s=t(6540);const c={},i=s.createContext(c);function r(e){const n=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:r(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/de828477.0759da02.js b/assets/js/de828477.0759da02.js deleted file mode 100644 index 8ba22e4..0000000 --- a/assets/js/de828477.0759da02.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[386],{4275:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>p,frontMatter:()=>i,metadata:()=>r,toc:()=>a});var o=t(4848),s=t(8453);const i={},l="Multi-File",r={id:"samples/components/multifile",title:"Multi-File",description:"Instead of writing the component code inline in our Script Box script, we can use the temploadstring global:",source:"@site/docs/samples/components/multifile.mdx",sourceDirName:"samples/components",slug:"/samples/components/multifile",permalink:"/samples/components/multifile",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"samplesSidebar",previous:{title:"Components",permalink:"/category/components"},next:{title:"Platformer",permalink:"/samples/components/platformer"}},c={},a=[];function m(e){const n={code:"code",h1:"h1",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"multi-file",children:"Multi-File"}),"\n",(0,o.jsxs)(n.p,{children:["Instead of writing the component code inline in our Script Box script, we can use the ",(0,o.jsx)(n.code,{children:"temp_load_string"})," global:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-lua",metastring:'title="Script Box script"',children:'reset(); -- Add `reset` function from the samples so this works\n\nlocal box = Scene:add_box({\n position = vec2(2, -19.5),\n size = vec2(0.5, 0.5),\n is_static = false,\n color = 0xa0a0ff,\n});\n\nprint(box.guid);\n\nlocal hash = Scene:add_component({\n name = "Multi-File Example",\n id = "@amytimed/test/multifile_example",\n version = "0.2.0",\n code = temp_load_string(\'/some/path/to/component.lua\')\n});\n\nbox:add_component(hash);\n'})}),"\n",(0,o.jsxs)(n.p,{children:["And then, in ",(0,o.jsx)(n.code,{children:"component.lua"})," (which we defined a path to earlier):"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-lua",metastring:'title="component.lua"',children:"function on_start()\n -- random rgb color\n local r = math.random(0x40, 0xff);\n local g = math.random(0x40, 0xff);\n local b = math.random(0x40, 0xff);\n\n -- put it together to form single color value, like 0xRRGGBB\n self.color = r * 0x10000 + g * 0x100 + b;\nend;\n"})}),"\n",(0,o.jsx)(n.p,{children:"Now, if we paste the first script into the Script Box and run it, it'll load the script defined in component.lua. Each time we press run, it'll reset the scene and create a box which sets its color to a random one."})]})}function p(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(m,{...e})}):m(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>l,x:()=>r});var o=t(6540);const s={},i=o.createContext(s);function l(e){const n=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/de828477.96011759.js b/assets/js/de828477.96011759.js new file mode 100644 index 0000000..1fb184a --- /dev/null +++ b/assets/js/de828477.96011759.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[386],{4275:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>p,frontMatter:()=>l,metadata:()=>r,toc:()=>a});var o=t(4848),i=t(8453);const l={title:"Multi-File",description:"Sample of how to work with Simulo Components in multiple files"},s="Multi-File",r={id:"samples/components/multifile",title:"Multi-File",description:"Sample of how to work with Simulo Components in multiple files",source:"@site/docs/samples/components/multifile.mdx",sourceDirName:"samples/components",slug:"/samples/components/multifile",permalink:"/samples/components/multifile",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{title:"Multi-File",description:"Sample of how to work with Simulo Components in multiple files"},sidebar:"samplesSidebar",previous:{title:"Components",permalink:"/category/components"},next:{title:"Platformer",permalink:"/samples/components/platformer"}},c={},a=[];function m(e){const n={code:"code",h1:"h1",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"multi-file",children:"Multi-File"}),"\n",(0,o.jsxs)(n.p,{children:["Instead of writing the component code inline in our Script Box script, we can use the ",(0,o.jsx)(n.code,{children:"temp_load_string"})," global:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-lua",metastring:'title="Script Box script"',children:'reset(); -- Add `reset` function from the samples so this works\n\nlocal box = Scene:add_box({\n position = vec2(2, -19.5),\n size = vec2(0.5, 0.5),\n is_static = false,\n color = 0xa0a0ff,\n});\n\nprint(box.guid);\n\nlocal hash = Scene:add_component({\n name = "Multi-File Example",\n id = "@amytimed/test/multifile_example",\n version = "0.2.0",\n code = temp_load_string(\'/some/path/to/component.lua\')\n});\n\nbox:add_component(hash);\n'})}),"\n",(0,o.jsxs)(n.p,{children:["And then, in ",(0,o.jsx)(n.code,{children:"component.lua"})," (which we defined a path to earlier):"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-lua",metastring:'title="component.lua"',children:"function on_start()\n -- random rgb color\n local r = math.random(0x40, 0xff);\n local g = math.random(0x40, 0xff);\n local b = math.random(0x40, 0xff);\n\n -- put it together to form single color value, like 0xRRGGBB\n self.color = r * 0x10000 + g * 0x100 + b;\nend;\n"})}),"\n",(0,o.jsx)(n.p,{children:"Now, if we paste the first script into the Script Box and run it, it'll load the script defined in component.lua. Each time we press run, it'll reset the scene and create a box which sets its color to a random one."})]})}function p(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(m,{...e})}):m(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>r});var o=t(6540);const i={},l=o.createContext(i);function s(e){const n=o.useContext(l);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),o.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/f959785f.14a880bb.js b/assets/js/f959785f.14a880bb.js deleted file mode 100644 index f9e66e0..0000000 --- a/assets/js/f959785f.14a880bb.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[382],{6199:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>a,toc:()=>r});var o=t(4848),s=t(8453);const i={},c="Components",a={id:"api/components/components",title:"Components",description:"Components are scripts you place on objects in Simulo. They're very powerful and allow doing almost anything with scripting, even creating a platformer game in Simulo.",source:"@site/docs/api/components/components.md",sourceDirName:"api/components",slug:"/api/components/",permalink:"/api/components/",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"apiSidebar",previous:{title:"Vec2",permalink:"/api/vec2"},next:{title:"Input",permalink:"/api/input/"}},l={},r=[{value:"Events",id:"events",level:2},{value:"on_start",id:"on_start",level:3},{value:"on_update",id:"on_update",level:3},{value:"on_event",id:"on_event",level:3},{value:"on_destroy",id:"on_destroy",level:3},{value:"Examples",id:"examples",level:2}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"components",children:"Components"}),"\n",(0,o.jsx)(n.p,{children:"Components are scripts you place on objects in Simulo. They're very powerful and allow doing almost anything with scripting, even creating a platformer game in Simulo."}),"\n",(0,o.jsx)(n.p,{children:"At the moment, no UI exists for creating components (though this will be changed before public release), but we can still create them using scripting."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-lua",children:'local box = Scene:add_box({\n position = vec2(0, 0),\n size = vec2(0.5, 0.5),\n color = 0xe5d3b9,\n is_static = false,\n});\n\nlocal hash = Scene:add_component({\n name = "Player Component",\n id = "@amytimed/test/player_component",\n version = "0.2.0",\n\n -- Lua/Luau code to make box "jump" when we press W key\n code = [[\n function on_update()\n if Input:key_just_pressed("W") then\n self:apply_force_to_center(vec2(0, 500));\n end;\n end;\n ]],\n});\n\nbox:add_component(hash); -- We can reuse the hash on other objects\n'})}),"\n",(0,o.jsxs)(n.p,{children:["You simply add a new component to the scene with ",(0,o.jsx)(n.code,{children:"Scene:add_component"}),", which returns a hash. You can then use ",(0,o.jsx)(n.code,{children:":add_component(hash)"})," on objects to apply the script on them."]}),"\n",(0,o.jsx)(n.h2,{id:"events",children:"Events"}),"\n",(0,o.jsxs)(n.p,{children:["Components have ",(0,o.jsx)(n.strong,{children:"event handler"})," functions which are called at certain times, such as ",(0,o.jsx)(n.code,{children:"on_update"}),", which is called each time the physics is updated."]}),"\n",(0,o.jsx)(n.h3,{id:"on_start",children:"on_start"}),"\n",(0,o.jsx)(n.p,{children:"This is called immediately when the component is added on an object."}),"\n",(0,o.jsxs)(n.p,{children:["At the moment, it is thus not particularly useful, since code ran outside of ",(0,o.jsx)(n.code,{children:"on_start"})," will run at the same time, but by the full release of Simulo, this function will get a table parameter called ",(0,o.jsx)(n.code,{children:"data"}),". An additional event named ",(0,o.jsx)(n.code,{children:"on_save"})," will be available, where the object can return a table to be passed to its ",(0,o.jsx)(n.code,{children:"on_start"})," when it is loaded."]}),"\n",(0,o.jsx)(n.h3,{id:"on_update",children:"on_update"}),"\n",(0,o.jsxs)(n.p,{children:["This is called each time the physics is updated. At the moment, that means ",(0,o.jsx)(n.code,{children:"64"})," times per second, though this will be changed to ",(0,o.jsx)(n.code,{children:"60"})," soon."]}),"\n",(0,o.jsx)(n.h3,{id:"on_event",children:"on_event"}),"\n",(0,o.jsx)(n.p,{children:"This function is not currently ever called, but it is coming in The Future"}),"\n",(0,o.jsx)(n.h3,{id:"on_destroy",children:"on_destroy"}),"\n",(0,o.jsx)(n.p,{children:"This function is called when the object is about to be destroyed. When it is called, the object is still completely intact."}),"\n",(0,o.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,o.jsxs)(n.p,{children:["For some examples, check out the ",(0,o.jsx)(n.a,{href:"/category/components",children:"Components section of the Samples"}),"."]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>c,x:()=>a});var o=t(6540);const s={},i=o.createContext(s);function c(e){const n=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:c(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/f959785f.9441d3ba.js b/assets/js/f959785f.9441d3ba.js new file mode 100644 index 0000000..d255df7 --- /dev/null +++ b/assets/js/f959785f.9441d3ba.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[382],{6199:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>i,metadata:()=>c,toc:()=>r});var o=t(4848),s=t(8453);const i={title:"Components",description:"Components are scripts you place on objects in Simulo. They're very powerful and allow doing almost anything with scripting, even creating a platformer game in Simulo."},a="Components",c={id:"api/components/components",title:"Components",description:"Components are scripts you place on objects in Simulo. They're very powerful and allow doing almost anything with scripting, even creating a platformer game in Simulo.",source:"@site/docs/api/components/components.md",sourceDirName:"api/components",slug:"/api/components/",permalink:"/api/components/",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{title:"Components",description:"Components are scripts you place on objects in Simulo. They're very powerful and allow doing almost anything with scripting, even creating a platformer game in Simulo."},sidebar:"apiSidebar",previous:{title:"Vec2",permalink:"/api/vec2"},next:{title:"Input",permalink:"/api/input/"}},l={},r=[{value:"Events",id:"events",level:2},{value:"on_start",id:"on_start",level:3},{value:"on_update",id:"on_update",level:3},{value:"on_event",id:"on_event",level:3},{value:"on_destroy",id:"on_destroy",level:3},{value:"Examples",id:"examples",level:2}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"components",children:"Components"}),"\n",(0,o.jsx)(n.p,{children:"Components are scripts you place on objects in Simulo. They're very powerful and allow doing almost anything with scripting, even creating a platformer game in Simulo."}),"\n",(0,o.jsx)(n.p,{children:"At the moment, no UI exists for creating components (though this will be changed before public release), but we can still create them using scripting."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-lua",children:'local box = Scene:add_box({\n position = vec2(0, 0),\n size = vec2(0.5, 0.5),\n color = 0xe5d3b9,\n is_static = false,\n});\n\nlocal hash = Scene:add_component({\n name = "Player Component",\n id = "@amytimed/test/player_component",\n version = "0.2.0",\n\n -- Lua/Luau code to make box "jump" when we press W key\n code = [[\n function on_update()\n if Input:key_just_pressed("W") then\n self:apply_force_to_center(vec2(0, 500));\n end;\n end;\n ]],\n});\n\nbox:add_component(hash); -- We can reuse the hash on other objects\n'})}),"\n",(0,o.jsxs)(n.p,{children:["You simply add a new component to the scene with ",(0,o.jsx)(n.code,{children:"Scene:add_component"}),", which returns a hash. You can then use ",(0,o.jsx)(n.code,{children:":add_component(hash)"})," on objects to apply the script on them."]}),"\n",(0,o.jsx)(n.h2,{id:"events",children:"Events"}),"\n",(0,o.jsxs)(n.p,{children:["Components have ",(0,o.jsx)(n.strong,{children:"event handler"})," functions which are called at certain times, such as ",(0,o.jsx)(n.code,{children:"on_update"}),", which is called each time the physics is updated."]}),"\n",(0,o.jsx)(n.h3,{id:"on_start",children:"on_start"}),"\n",(0,o.jsx)(n.p,{children:"This is called immediately when the component is added on an object."}),"\n",(0,o.jsxs)(n.p,{children:["At the moment, it is thus not particularly useful, since code ran outside of ",(0,o.jsx)(n.code,{children:"on_start"})," will run at the same time, but by the full release of Simulo, this function will get a table parameter called ",(0,o.jsx)(n.code,{children:"data"}),". An additional event named ",(0,o.jsx)(n.code,{children:"on_save"})," will be available, where the object can return a table to be passed to its ",(0,o.jsx)(n.code,{children:"on_start"})," when it is loaded."]}),"\n",(0,o.jsx)(n.h3,{id:"on_update",children:"on_update"}),"\n",(0,o.jsxs)(n.p,{children:["This is called each time the physics is updated. At the moment, that means ",(0,o.jsx)(n.code,{children:"64"})," times per second, though this will be changed to ",(0,o.jsx)(n.code,{children:"60"})," soon."]}),"\n",(0,o.jsx)(n.h3,{id:"on_event",children:"on_event"}),"\n",(0,o.jsx)(n.p,{children:"This function is not currently ever called, but it is coming in The Future"}),"\n",(0,o.jsx)(n.h3,{id:"on_destroy",children:"on_destroy"}),"\n",(0,o.jsx)(n.p,{children:"This function is called when the object is about to be destroyed. When it is called, the object is still completely intact."}),"\n",(0,o.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,o.jsxs)(n.p,{children:["For some examples, check out the ",(0,o.jsx)(n.a,{href:"/category/components",children:"Components section of the Samples"}),"."]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>c});var o=t(6540);const s={},i=o.createContext(s);function a(e){const n=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/main.b997f003.js b/assets/js/main.670b4723.js similarity index 99% rename from assets/js/main.b997f003.js rename to assets/js/main.670b4723.js index c46928c..d608079 100644 --- a/assets/js/main.b997f003.js +++ b/assets/js/main.670b4723.js @@ -1,2 +1,2 @@ -/*! For license information please see main.b997f003.js.LICENSE.txt */ -(self.webpackChunksimulo_docs=self.webpackChunksimulo_docs||[]).push([[792],{1205:(e,t,n)=>{"use strict";n.d(t,{mg:()=>J,vd:()=>W});var r=n(6540),a=n(5556),o=n.n(a),i=n(115),l=n.n(i),s=n(311),u=n.n(s),c=n(2833),d=n.n(c);function f(){return f=Object.assign||function(e){for(var t=1;t=0||(a[n]=e[n]);return a}var h={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title",FRAGMENT:"Symbol(react.fragment)"},y={rel:["amphtml","canonical","alternate"]},b={type:["application/ld+json"]},v={charset:"",name:["robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},w=Object.keys(h).map((function(e){return h[e]})),k={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},x=Object.keys(k).reduce((function(e,t){return e[k[t]]=t,e}),{}),S=function(e,t){for(var n=e.length-1;n>=0;n-=1){var r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},E=function(e){var t=S(e,h.TITLE),n=S(e,"titleTemplate");if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,(function(){return t}));var r=S(e,"defaultTitle");return t||r||void 0},C=function(e){return S(e,"onChangeClientState")||function(){}},_=function(e,t){return t.filter((function(t){return void 0!==t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return f({},e,t)}),{})},A=function(e,t){return t.filter((function(e){return void 0!==e[h.BASE]})).map((function(e){return e[h.BASE]})).reverse().reduce((function(t,n){if(!t.length)for(var r=Object.keys(n),a=0;a/g,">").replace(/"/g,""").replace(/'/g,"'")},I=function(e){return Object.keys(e).reduce((function(t,n){var r=void 0!==e[n]?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r}),"")},F=function(e,t){return void 0===t&&(t={}),Object.keys(e).reduce((function(t,n){return t[k[n]||n]=e[n],t}),t)},M=function(e,t){return t.map((function(t,n){var a,o=((a={key:n})["data-rh"]=!0,a);return Object.keys(t).forEach((function(e){var n=k[e]||e;"innerHTML"===n||"cssText"===n?o.dangerouslySetInnerHTML={__html:t.innerHTML||t.cssText}:o[n]=t[e]})),r.createElement(e,o)}))},D=function(e,t,n){switch(e){case h.TITLE:return{toComponent:function(){return n=t.titleAttributes,(a={key:e=t.title})["data-rh"]=!0,o=F(n,a),[r.createElement(h.TITLE,o,e)];var e,n,a,o},toString:function(){return function(e,t,n,r){var a=I(n),o=j(t);return a?"<"+e+' data-rh="true" '+a+">"+R(o,r)+"":"<"+e+' data-rh="true">'+R(o,r)+""}(e,t.title,t.titleAttributes,n)}};case"bodyAttributes":case"htmlAttributes":return{toComponent:function(){return F(t)},toString:function(){return I(t)}};default:return{toComponent:function(){return M(e,t)},toString:function(){return function(e,t,n){return t.reduce((function(t,r){var a=Object.keys(r).filter((function(e){return!("innerHTML"===e||"cssText"===e)})).reduce((function(e,t){var a=void 0===r[t]?t:t+'="'+R(r[t],n)+'"';return e?e+" "+a:a}),""),o=r.innerHTML||r.cssText||"",i=-1===O.indexOf(e);return t+"<"+e+' data-rh="true" '+a+(i?"/>":">"+o+"")}),"")}(e,t,n)}}}},z=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,a=e.htmlAttributes,o=e.noscriptTags,i=e.styleTags,l=e.title,s=void 0===l?"":l,u=e.titleAttributes,c=e.linkTags,d=e.metaTags,f=e.scriptTags,p={toComponent:function(){},toString:function(){return""}};if(e.prioritizeSeoTags){var m=function(e){var t=e.linkTags,n=e.scriptTags,r=e.encode,a=L(e.metaTags,v),o=L(t,y),i=L(n,b);return{priorityMethods:{toComponent:function(){return[].concat(M(h.META,a.priority),M(h.LINK,o.priority),M(h.SCRIPT,i.priority))},toString:function(){return D(h.META,a.priority,r)+" "+D(h.LINK,o.priority,r)+" "+D(h.SCRIPT,i.priority,r)}},metaTags:a.default,linkTags:o.default,scriptTags:i.default}}(e);p=m.priorityMethods,c=m.linkTags,d=m.metaTags,f=m.scriptTags}return{priority:p,base:D(h.BASE,t,r),bodyAttributes:D("bodyAttributes",n,r),htmlAttributes:D("htmlAttributes",a,r),link:D(h.LINK,c,r),meta:D(h.META,d,r),noscript:D(h.NOSCRIPT,o,r),script:D(h.SCRIPT,f,r),style:D(h.STYLE,i,r),title:D(h.TITLE,{title:s,titleAttributes:u},r)}},B=[],$=function(e,t){var n=this;void 0===t&&(t="undefined"!=typeof document),this.instances=[],this.value={setHelmet:function(e){n.context.helmet=e},helmetInstances:{get:function(){return n.canUseDOM?B:n.instances},add:function(e){(n.canUseDOM?B:n.instances).push(e)},remove:function(e){var t=(n.canUseDOM?B:n.instances).indexOf(e);(n.canUseDOM?B:n.instances).splice(t,1)}}},this.context=e,this.canUseDOM=t,t||(e.helmet=z({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))},U=r.createContext({}),H=o().shape({setHelmet:o().func,helmetInstances:o().shape({get:o().func,add:o().func,remove:o().func})}),V="undefined"!=typeof document,W=function(e){function t(n){var r;return(r=e.call(this,n)||this).helmetData=new $(r.props.context,t.canUseDOM),r}return p(t,e),t.prototype.render=function(){return r.createElement(U.Provider,{value:this.helmetData.value},this.props.children)},t}(r.Component);W.canUseDOM=V,W.propTypes={context:o().shape({helmet:o().shape()}),children:o().node.isRequired},W.defaultProps={context:{}},W.displayName="HelmetProvider";var q=function(e,t){var n,r=document.head||document.querySelector(h.HEAD),a=r.querySelectorAll(e+"[data-rh]"),o=[].slice.call(a),i=[];return t&&t.length&&t.forEach((function(t){var r=document.createElement(e);for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&("innerHTML"===a?r.innerHTML=t.innerHTML:"cssText"===a?r.styleSheet?r.styleSheet.cssText=t.cssText:r.appendChild(document.createTextNode(t.cssText)):r.setAttribute(a,void 0===t[a]?"":t[a]));r.setAttribute("data-rh","true"),o.some((function(e,t){return n=t,r.isEqualNode(e)}))?o.splice(n,1):i.push(r)})),o.forEach((function(e){return e.parentNode.removeChild(e)})),i.forEach((function(e){return r.appendChild(e)})),{oldTags:o,newTags:i}},G=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute("data-rh"),a=r?r.split(","):[],o=[].concat(a),i=Object.keys(t),l=0;l=0;d-=1)n.removeAttribute(o[d]);a.length===o.length?n.removeAttribute("data-rh"):n.getAttribute("data-rh")!==i.join(",")&&n.setAttribute("data-rh",i.join(","))}},Y=function(e,t){var n=e.baseTag,r=e.htmlAttributes,a=e.linkTags,o=e.metaTags,i=e.noscriptTags,l=e.onChangeClientState,s=e.scriptTags,u=e.styleTags,c=e.title,d=e.titleAttributes;G(h.BODY,e.bodyAttributes),G(h.HTML,r),function(e,t){void 0!==e&&document.title!==e&&(document.title=j(e)),G(h.TITLE,t)}(c,d);var f={baseTag:q(h.BASE,n),linkTags:q(h.LINK,a),metaTags:q(h.META,o),noscriptTags:q(h.NOSCRIPT,i),scriptTags:q(h.SCRIPT,s),styleTags:q(h.STYLE,u)},p={},m={};Object.keys(f).forEach((function(e){var t=f[e],n=t.newTags,r=t.oldTags;n.length&&(p[e]=n),r.length&&(m[e]=f[e].oldTags)})),t&&t(),l(e,p,m)},Q=null,K=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a elements are self-closing and can not contain children. Refer to our API for more information.")}},n.flattenArrayTypeChildren=function(e){var t,n=e.child,r=e.arrayTypeChildren;return f({},r,((t={})[n.type]=[].concat(r[n.type]||[],[f({},e.newChildProps,this.mapNestedChildrenToProps(n,e.nestedChildren))]),t))},n.mapObjectTypeChildren=function(e){var t,n,r=e.child,a=e.newProps,o=e.newChildProps,i=e.nestedChildren;switch(r.type){case h.TITLE:return f({},a,((t={})[r.type]=i,t.titleAttributes=f({},o),t));case h.BODY:return f({},a,{bodyAttributes:f({},o)});case h.HTML:return f({},a,{htmlAttributes:f({},o)});default:return f({},a,((n={})[r.type]=f({},o),n))}},n.mapArrayTypeChildrenToProps=function(e,t){var n=f({},t);return Object.keys(e).forEach((function(t){var r;n=f({},n,((r={})[t]=e[t],r))})),n},n.warnOnInvalidChildren=function(e,t){return u()(w.some((function(t){return e.type===t})),"function"==typeof e.type?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":"Only elements types "+w.join(", ")+" are allowed. Helmet does not support rendering <"+e.type+"> elements. Refer to our API for more information."),u()(!t||"string"==typeof t||Array.isArray(t)&&!t.some((function(e){return"string"!=typeof e})),"Helmet expects a string as a child of <"+e.type+">. Did you forget to wrap your children in braces? ( <"+e.type+">{``} ) Refer to our API for more information."),!0},n.mapChildrenToProps=function(e,t){var n=this,a={};return r.Children.forEach(e,(function(e){if(e&&e.props){var r=e.props,o=r.children,i=g(r,Z),l=Object.keys(i).reduce((function(e,t){return e[x[t]||t]=i[t],e}),{}),s=e.type;switch("symbol"==typeof s?s=s.toString():n.warnOnInvalidChildren(e,o),s){case h.FRAGMENT:t=n.mapChildrenToProps(o,t);break;case h.LINK:case h.META:case h.NOSCRIPT:case h.SCRIPT:case h.STYLE:a=n.flattenArrayTypeChildren({child:e,arrayTypeChildren:a,newChildProps:l,nestedChildren:o});break;default:t=n.mapObjectTypeChildren({child:e,newProps:t,newChildProps:l,nestedChildren:o})}}})),this.mapArrayTypeChildrenToProps(a,t)},n.render=function(){var e=this.props,t=e.children,n=g(e,X),a=f({},n),o=n.helmetData;return t&&(a=this.mapChildrenToProps(t,a)),!o||o instanceof $||(o=new $(o.context,o.instances)),o?r.createElement(K,f({},a,{context:o.value,helmetData:void 0})):r.createElement(U.Consumer,null,(function(e){return r.createElement(K,f({},a,{context:e}))}))},t}(r.Component);J.propTypes={base:o().object,bodyAttributes:o().object,children:o().oneOfType([o().arrayOf(o().node),o().node]),defaultTitle:o().string,defer:o().bool,encodeSpecialCharacters:o().bool,htmlAttributes:o().object,link:o().arrayOf(o().object),meta:o().arrayOf(o().object),noscript:o().arrayOf(o().object),onChangeClientState:o().func,script:o().arrayOf(o().object),style:o().arrayOf(o().object),title:o().string,titleAttributes:o().object,titleTemplate:o().string,prioritizeSeoTags:o().bool,helmetData:o().object},J.defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1},J.displayName="Helmet"},463:(e,t,n)=>{"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){return i=Object.assign||function(e){for(var t=1;t{"use strict";n.d(t,{A:()=>f});n(6540);var r=n(463),a=n.n(r),o=n(4054);const i={"14eb3368":[()=>Promise.all([n.e(869),n.e(969)]).then(n.bind(n,7247)),"@theme/DocCategoryGeneratedIndexPage",7247],17896441:[()=>Promise.all([n.e(869),n.e(688),n.e(401)]).then(n.bind(n,3652)),"@theme/DocItem",3652],"1df93b7f":[()=>Promise.all([n.e(869),n.e(583)]).then(n.bind(n,8198)),"@site/src/pages/index.tsx",8198],"1f391b9e":[()=>Promise.all([n.e(869),n.e(688),n.e(61)]).then(n.bind(n,7973)),"@theme/MDXPage",7973],"22dd74f7":[()=>n.e(567).then(n.t.bind(n,5226,19)),"@generated/docusaurus-plugin-content-docs/default/p/index-466.json",5226],"26f6ec2d":[()=>n.e(801).then(n.bind(n,3823)),"@site/docs/api/input/input.mdx",3823],"2c273a5f":[()=>n.e(306).then(n.bind(n,692)),"@site/docs/samples/components/platformer.mdx",692],"35fb1769":[()=>n.e(736).then(n.bind(n,5742)),"@site/docs/samples/reset.md",5742],"382a2208":[()=>n.e(21).then(n.bind(n,5984)),"@site/docs/api/intro.mdx",5984],"393be207":[()=>n.e(134).then(n.bind(n,5943)),"@site/src/pages/markdown-page.md",5943],"43de45f6":[()=>n.e(732).then(n.t.bind(n,7387,19)),"@generated/docusaurus-plugin-content-docs/default/p/category-components-d55.json",7387],"5723fde7":[()=>n.e(976).then(n.bind(n,2541)),"@site/docs/samples/themes.mdx",2541],"5e95c892":[()=>n.e(647).then(n.bind(n,7121)),"@theme/DocsRoot",7121],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,4784)),"@generated/docusaurus.config",4784],"6a638f41":[()=>n.e(506).then(n.bind(n,8741)),"@site/docs/api/simuloobject/simuloobject.mdx",8741],"70f34273":[()=>n.e(111).then(n.bind(n,3601)),"@site/docs/api/scene/scene.md",3601],a7456010:[()=>n.e(235).then(n.t.bind(n,8552,19)),"@generated/docusaurus-plugin-content-pages/default/__plugin.json",8552],a7bd4aaa:[()=>n.e(98).then(n.bind(n,4532)),"@theme/DocVersionRoot",4532],a94703ab:[()=>Promise.all([n.e(869),n.e(48)]).then(n.bind(n,2559)),"@theme/DocRoot",2559],aba21aa0:[()=>n.e(742).then(n.t.bind(n,7093,19)),"@generated/docusaurus-plugin-content-docs/default/__plugin.json",7093],d4f3c2d4:[()=>n.e(317).then(n.bind(n,9927)),"@site/docs/samples/intro.md",9927],d70d3333:[()=>n.e(524).then(n.bind(n,1876)),"@site/docs/api/vec2.mdx",1876],de828477:[()=>n.e(386).then(n.bind(n,4275)),"@site/docs/samples/components/multifile.mdx",4275],f959785f:[()=>n.e(382).then(n.bind(n,6199)),"@site/docs/api/components/components.md",6199]};var l=n(4848);function s(e){let{error:t,retry:n,pastDelay:r}=e;return t?(0,l.jsxs)("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"},children:[(0,l.jsx)("p",{children:String(t)}),(0,l.jsx)("div",{children:(0,l.jsx)("button",{type:"button",onClick:n,children:"Retry"})})]}):r?(0,l.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,l.jsx)("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb",children:(0,l.jsxs)("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2",children:[(0,l.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,l.jsx)("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,l.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,l.jsx)("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,l.jsx)("circle",{cx:"22",cy:"22",r:"8",children:(0,l.jsx)("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"})})]})})}):null}var u=n(6921),c=n(3102);function d(e,t){if("*"===e)return a()({loading:s,loader:()=>n.e(237).then(n.bind(n,2237)),modules:["@theme/NotFound"],webpack:()=>[2237],render(e,t){const n=e.default;return(0,l.jsx)(c.W,{value:{plugin:{name:"native",id:"default"}},children:(0,l.jsx)(n,{...t})})}});const r=o[`${e}-${t}`],d={},f=[],p=[],m=(0,u.A)(r);return Object.entries(m).forEach((e=>{let[t,n]=e;const r=i[n];r&&(d[t]=r[0],f.push(r[1]),p.push(r[2]))})),a().Map({loading:s,loader:d,modules:f,webpack:()=>p,render(t,n){const a=JSON.parse(JSON.stringify(r));Object.entries(t).forEach((t=>{let[n,r]=t;const o=r.default;if(!o)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof o&&"function"!=typeof o||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{o[e]=r[e]}));let i=a;const l=n.split(".");l.slice(0,-1).forEach((e=>{i=i[e]})),i[l[l.length-1]]=o}));const o=a.__comp;delete a.__comp;const i=a.__context;delete a.__context;const s=a.__props;return delete a.__props,(0,l.jsx)(c.W,{value:i,children:(0,l.jsx)(o,{...a,...s,...n})})}})}const f=[{path:"/markdown-page/",component:d("/markdown-page/","54d"),exact:!0},{path:"/",component:d("/","e5f"),exact:!0},{path:"/",component:d("/","a48"),routes:[{path:"/",component:d("/","471"),routes:[{path:"/",component:d("/","b43"),routes:[{path:"/api/components/",component:d("/api/components/","91c"),exact:!0,sidebar:"apiSidebar"},{path:"/api/input/",component:d("/api/input/","f50"),exact:!0,sidebar:"apiSidebar"},{path:"/api/intro/",component:d("/api/intro/","c42"),exact:!0,sidebar:"apiSidebar"},{path:"/api/scene/",component:d("/api/scene/","60a"),exact:!0,sidebar:"apiSidebar"},{path:"/api/simuloobject/",component:d("/api/simuloobject/","da6"),exact:!0,sidebar:"apiSidebar"},{path:"/api/vec2/",component:d("/api/vec2/","1f2"),exact:!0,sidebar:"apiSidebar"},{path:"/category/components/",component:d("/category/components/","781"),exact:!0,sidebar:"samplesSidebar"},{path:"/samples/components/multifile/",component:d("/samples/components/multifile/","a67"),exact:!0,sidebar:"samplesSidebar"},{path:"/samples/components/platformer/",component:d("/samples/components/platformer/","c5e"),exact:!0,sidebar:"samplesSidebar"},{path:"/samples/intro/",component:d("/samples/intro/","e67"),exact:!0,sidebar:"samplesSidebar"},{path:"/samples/reset/",component:d("/samples/reset/","e3f"),exact:!0,sidebar:"samplesSidebar"},{path:"/samples/themes/",component:d("/samples/themes/","5f2"),exact:!0,sidebar:"samplesSidebar"}]}]}]},{path:"*",component:d("*")}]},6125:(e,t,n)=>{"use strict";n.d(t,{o:()=>o,x:()=>i});var r=n(6540),a=n(4848);const o=r.createContext(!1);function i(e){let{children:t}=e;const[n,i]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{i(!0)}),[]),(0,a.jsx)(o.Provider,{value:n,children:t})}},8536:(e,t,n)=>{"use strict";var r=n(6540),a=n(5338),o=n(1205),i=n(4625),l=n(4784),s=n(8193);const u=[n(119),n(6134),n(6294),n(1043)];var c=n(8328),d=n(6347),f=n(2831),p=n(4848);function m(e){let{children:t}=e;return(0,p.jsx)(p.Fragment,{children:t})}var g=n(5260),h=n(4586),y=n(6025),b=n(6342),v=n(1003),w=n(2131),k=n(4090),x=n(2967),S=n(440),E=n(1463);function C(){const{i18n:{currentLocale:e,defaultLocale:t,localeConfigs:n}}=(0,h.A)(),r=(0,w.o)(),a=n[e].htmlLang,o=e=>e.replace("-","_");return(0,p.jsxs)(g.A,{children:[Object.entries(n).map((e=>{let[t,{htmlLang:n}]=e;return(0,p.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:n},t)})),(0,p.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:"x-default"}),(0,p.jsx)("meta",{property:"og:locale",content:o(a)}),Object.values(n).filter((e=>a!==e.htmlLang)).map((e=>(0,p.jsx)("meta",{property:"og:locale:alternate",content:o(e.htmlLang)},`meta-og-${e.htmlLang}`)))]})}function _(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,h.A)(),r=function(){const{siteConfig:{url:e,baseUrl:t,trailingSlash:n}}=(0,h.A)(),{pathname:r}=(0,d.zy)();return e+(0,S.applyTrailingSlash)((0,y.Ay)(r),{trailingSlash:n,baseUrl:t})}(),a=t?`${n}${t}`:r;return(0,p.jsxs)(g.A,{children:[(0,p.jsx)("meta",{property:"og:url",content:a}),(0,p.jsx)("link",{rel:"canonical",href:a})]})}function A(){const{i18n:{currentLocale:e}}=(0,h.A)(),{metadata:t,image:n}=(0,b.p)();return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(g.A,{children:[(0,p.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,p.jsx)("body",{className:k.w})]}),n&&(0,p.jsx)(v.be,{image:n}),(0,p.jsx)(_,{}),(0,p.jsx)(C,{}),(0,p.jsx)(E.A,{tag:x.Cy,locale:e}),(0,p.jsx)(g.A,{children:t.map(((e,t)=>(0,p.jsx)("meta",{...e},t)))})]})}const T=new Map;var N=n(6125),j=n(6988),L=n(205);function P(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{const r=t.default?.[e]??t[e];return r?.(...n)}));return()=>a.forEach((e=>e?.()))}const O=function(e){let{children:t,location:n,previousLocation:r}=e;return(0,L.A)((()=>{r!==n&&(!function(e){let{location:t,previousLocation:n}=e;if(!n)return;const r=t.pathname===n.pathname,a=t.hash===n.hash,o=t.search===n.search;if(r&&a&&!o)return;const{hash:i}=t;if(i){const e=decodeURIComponent(i.substring(1)),t=document.getElementById(e);t?.scrollIntoView()}else window.scrollTo(0,0)}({location:n,previousLocation:r}),P("onRouteDidUpdate",{previousLocation:r,location:n}))}),[r,n]),t};function R(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,f.u)(c.A,e))).flat();return Promise.all(t.map((e=>e.route.component.preload?.())))}class I extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=s.A.canUseDOM?P("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=P("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),R(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return(0,p.jsx)(O,{previousLocation:this.previousLocation,location:t,children:(0,p.jsx)(d.qh,{location:t,render:()=>e})})}}const F=I,M="__docusaurus-base-url-issue-banner-container",D="__docusaurus-base-url-issue-banner",z="__docusaurus-base-url-issue-banner-suggestion-container";function B(e){return`\ndocument.addEventListener('DOMContentLoaded', function maybeInsertBanner() {\n var shouldInsert = typeof window['docusaurus'] === 'undefined';\n shouldInsert && insertBanner();\n});\n\nfunction insertBanner() {\n var bannerContainer = document.createElement('div');\n bannerContainer.id = '${M}';\n var bannerHtml = ${JSON.stringify(function(e){return`\n
\n

Your Docusaurus site did not load properly.

\n

A very common reason is a wrong site baseUrl configuration.

\n

Current configured baseUrl = ${e} ${"/"===e?" (default value)":""}

\n

We suggest trying baseUrl =

\n
\n`}(e)).replace(/{let{route:t}=e;return!0===t.exact})))return T.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return T.set(e.pathname,t),{...e,pathname:t}}((0,d.zy)());return(0,p.jsx)(F,{location:e,children:G})}function Q(){return(0,p.jsx)(V.A,{children:(0,p.jsx)(j.l,{children:(0,p.jsxs)(N.x,{children:[(0,p.jsxs)(m,{children:[(0,p.jsx)(H,{}),(0,p.jsx)(A,{}),(0,p.jsx)(U,{}),(0,p.jsx)(Y,{})]}),(0,p.jsx)(q,{})]})})})}var K=n(4054);const Z=function(e){try{return document.createElement("link").relList.supports(e)}catch{return!1}}("prefetch")?function(e){return new Promise(((t,n)=>{if("undefined"==typeof document)return void n();const r=document.createElement("link");r.setAttribute("rel","prefetch"),r.setAttribute("href",e),r.onload=()=>t(),r.onerror=()=>n();const a=document.getElementsByTagName("head")[0]??document.getElementsByName("script")[0]?.parentNode;a?.appendChild(r)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var X=n(6921);const J=new Set,ee=new Set,te=()=>navigator.connection?.effectiveType.includes("2g")||navigator.connection?.saveData,ne={prefetch:e=>{if(!(e=>!te()&&!ee.has(e)&&!J.has(e))(e))return!1;J.add(e);const t=(0,f.u)(c.A,e).flatMap((e=>{return t=e.route.path,Object.entries(K).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,X.A)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?Z(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!te()&&!ee.has(e))(e)&&(ee.add(e),R(e))},re=Object.freeze(ne);function ae(e){let{children:t}=e;return"hash"===l.default.future.experimental_router?(0,p.jsx)(i.I9,{children:t}):(0,p.jsx)(i.Kd,{children:t})}const oe=Boolean(!0);if(s.A.canUseDOM){window.docusaurus=re;const e=document.getElementById("__docusaurus"),t=(0,p.jsx)(o.vd,{children:(0,p.jsx)(ae,{children:(0,p.jsx)(Q,{})})}),n=(e,t)=>{console.error("Docusaurus React Root onRecoverableError:",e,t)},i=()=>{if(window.docusaurusRoot)window.docusaurusRoot.render(t);else if(oe)window.docusaurusRoot=a.hydrateRoot(e,t,{onRecoverableError:n});else{const r=a.createRoot(e,{onRecoverableError:n});r.render(t),window.docusaurusRoot=r}};R(window.location.pathname).then((()=>{(0,r.startTransition)(i)}))}},6988:(e,t,n)=>{"use strict";n.d(t,{o:()=>d,l:()=>f});var r=n(6540),a=n(4784);const o=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/","versions":[{"name":"current","label":"Next","isLast":true,"path":"/","mainDocId":"api/intro","docs":[{"id":"api/components/components","path":"/api/components/","sidebar":"apiSidebar"},{"id":"api/input/input","path":"/api/input/","sidebar":"apiSidebar"},{"id":"api/intro","path":"/api/intro","sidebar":"apiSidebar"},{"id":"api/scene/scene","path":"/api/scene/","sidebar":"apiSidebar"},{"id":"api/simuloobject/simuloobject","path":"/api/simuloobject/","sidebar":"apiSidebar"},{"id":"api/vec2","path":"/api/vec2","sidebar":"apiSidebar"},{"id":"samples/components/multifile","path":"/samples/components/multifile","sidebar":"samplesSidebar"},{"id":"samples/components/platformer","path":"/samples/components/platformer","sidebar":"samplesSidebar"},{"id":"samples/intro","path":"/samples/intro","sidebar":"samplesSidebar"},{"id":"samples/reset","path":"/samples/reset","sidebar":"samplesSidebar"},{"id":"samples/themes","path":"/samples/themes","sidebar":"samplesSidebar"},{"id":"/category/components","path":"/category/components","sidebar":"samplesSidebar"}],"draftIds":[],"sidebars":{"apiSidebar":{"link":{"path":"/api/intro","label":"api/intro"}},"samplesSidebar":{"link":{"path":"/samples/intro","label":"samples/intro"}}}}],"breadcrumbs":true}}}'),i=JSON.parse('{"defaultLocale":"en","locales":["en"],"path":"i18n","currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory","path":"en"}}}');var l=n(2654);const s=JSON.parse('{"docusaurusVersion":"3.4.0","siteVersion":"0.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"3.4.0"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"3.4.0"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"3.4.0"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"3.4.0"}}}');var u=n(4848);const c={siteConfig:a.default,siteMetadata:s,globalData:o,i18n:i,codeTranslations:l},d=r.createContext(c);function f(e){let{children:t}=e;return(0,u.jsx)(d.Provider,{value:c,children:t})}},7489:(e,t,n)=>{"use strict";n.d(t,{A:()=>g});var r=n(6540),a=n(8193),o=n(5260),i=n(440),l=n(781),s=n(3102),u=n(4848);function c(e){let{error:t,tryAgain:n}=e;return(0,u.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",minHeight:"100vh",width:"100%",maxWidth:"80ch",fontSize:"20px",margin:"0 auto",padding:"1rem"},children:[(0,u.jsx)("h1",{style:{fontSize:"3rem"},children:"This page crashed"}),(0,u.jsx)("button",{type:"button",onClick:n,style:{margin:"1rem 0",fontSize:"2rem",cursor:"pointer",borderRadius:20,padding:"1rem"},children:"Try again"}),(0,u.jsx)(d,{error:t})]})}function d(e){let{error:t}=e;const n=(0,i.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,u.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:n})}function f(e){let{children:t}=e;return(0,u.jsx)(s.W,{value:{plugin:{name:"docusaurus-core-error-boundary",id:"default"}},children:t})}function p(e){let{error:t,tryAgain:n}=e;return(0,u.jsx)(f,{children:(0,u.jsxs)(g,{fallback:()=>(0,u.jsx)(c,{error:t,tryAgain:n}),children:[(0,u.jsx)(o.A,{children:(0,u.jsx)("title",{children:"Page Error"})}),(0,u.jsx)(l.A,{children:(0,u.jsx)(c,{error:t,tryAgain:n})})]})})}const m=e=>(0,u.jsx)(p,{...e});class g extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){a.A.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??m)(e)}return e??null}}},8193:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document,a={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},5260:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);var r=n(1205),a=n(4848);function o(e){return(0,a.jsx)(r.mg,{...e})}},8774:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(6540),a=n(4625),o=n(440),i=n(4586),l=n(6654),s=n(8193),u=n(3427),c=n(6025),d=n(4848);function f(e,t){let{isNavLink:n,to:f,href:p,activeClassName:m,isActive:g,"data-noBrokenLinkCheck":h,autoAddBaseUrl:y=!0,...b}=e;const{siteConfig:v}=(0,i.A)(),{trailingSlash:w,baseUrl:k}=v,x=v.future.experimental_router,{withBaseUrl:S}=(0,c.hH)(),E=(0,u.A)(),C=(0,r.useRef)(null);(0,r.useImperativeHandle)(t,(()=>C.current));const _=f||p;const A=(0,l.A)(_),T=_?.replace("pathname://","");let N=void 0!==T?(j=T,y&&(e=>e.startsWith("/"))(j)?S(j):j):void 0;var j;"hash"===x&&N?.startsWith("./")&&(N=N?.slice(1)),N&&A&&(N=(0,o.applyTrailingSlash)(N,{trailingSlash:w,baseUrl:k}));const L=(0,r.useRef)(!1),P=n?a.k2:a.N_,O=s.A.canUseIntersectionObserver,R=(0,r.useRef)(),I=()=>{L.current||null==N||(window.docusaurus.preload(N),L.current=!0)};(0,r.useEffect)((()=>(!O&&A&&null!=N&&window.docusaurus.prefetch(N),()=>{O&&R.current&&R.current.disconnect()})),[R,N,O,A]);const F=N?.startsWith("#")??!1,M=!b.target||"_self"===b.target,D=!N||!A||!M;return h||!F&&D||E.collectLink(N),b.id&&E.collectAnchor(b.id),D?(0,d.jsx)("a",{ref:C,href:N,..._&&!A&&{target:"_blank",rel:"noopener noreferrer"},...b}):(0,d.jsx)(P,{...b,onMouseEnter:I,onTouchStart:I,innerRef:e=>{C.current=e,O&&e&&A&&(R.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(R.current.unobserve(e),R.current.disconnect(),null!=N&&window.docusaurus.prefetch(N))}))})),R.current.observe(e))},to:N,...n&&{isActive:g,activeClassName:m}})}const p=r.forwardRef(f)},418:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=()=>null},1312:(e,t,n)=>{"use strict";n.d(t,{A:()=>u,T:()=>s});var r=n(6540),a=n(4848);function o(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=t?.[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var i=n(2654);function l(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return i[t??n]??n??t}function s(e,t){let{message:n,id:r}=e;return o(l({message:n,id:r}),t)}function u(e){let{children:t,id:n,values:r}=e;if(t&&"string"!=typeof t)throw console.warn("Illegal children",t),new Error("The Docusaurus component only accept simple string values");const i=l({message:t,id:n});return(0,a.jsx)(a.Fragment,{children:o(i,r)})}},7065:(e,t,n)=>{"use strict";n.d(t,{W:()=>r});const r="default"},6654:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,{A:()=>a,z:()=>r})},6025:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>l,hH:()=>i});var r=n(6540),a=n(4586),o=n(6654);function i(){const{siteConfig:e}=(0,a.A)(),{baseUrl:t,url:n}=e,i=e.future.experimental_router,l=(0,r.useCallback)(((e,r)=>function(e){let{siteUrl:t,baseUrl:n,url:r,options:{forcePrependBaseUrl:a=!1,absolute:i=!1}={},router:l}=e;if(!r||r.startsWith("#")||(0,o.z)(r))return r;if("hash"===l)return r.startsWith("/")?`.${r}`:`./${r}`;if(a)return n+r.replace(/^\//,"");if(r===n.replace(/\/$/,""))return n;const s=r.startsWith(n)?r:n+r.replace(/^\//,"");return i?t+s:s}({siteUrl:n,baseUrl:t,url:e,options:r,router:i})),[n,t,i]);return{withBaseUrl:l}}function l(e,t){void 0===t&&(t={});const{withBaseUrl:n}=i();return n(e,t)}},3427:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(6540);n(4848);const a=r.createContext({collectAnchor:()=>{},collectLink:()=>{}}),o=()=>(0,r.useContext)(a);function i(){return o()}},4586:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(6988);function o(){return(0,r.useContext)(a.o)}},2303:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(6125);function o(){return(0,r.useContext)(a.o)}},205:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(6540);const a=n(8193).A.canUseDOM?r.useLayoutEffect:r.useEffect},6921:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r=e=>"object"==typeof e&&!!e&&Object.keys(e).length>0;function a(e){const t={};return function e(n,a){Object.entries(n).forEach((n=>{let[o,i]=n;const l=a?`${a}.${o}`:o;r(i)?e(i,l):t[l]=i}))}(e),t}},3102:(e,t,n)=>{"use strict";n.d(t,{W:()=>i,o:()=>o});var r=n(6540),a=n(4848);const o=r.createContext(null);function i(e){let{children:t,value:n}=e;const i=r.useContext(o),l=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}const r={...t.data,...n?.data};return{plugin:t.plugin,data:r}}({parent:i,value:n})),[i,n]);return(0,a.jsx)(o.Provider,{value:l,children:t})}},4070:(e,t,n)=>{"use strict";n.d(t,{zK:()=>g,vT:()=>f,Gy:()=>c,HW:()=>h,ht:()=>d,r7:()=>m,jh:()=>p});var r=n(6347),a=n(4586),o=n(7065);function i(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,a.A)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}const l=e=>e.versions.find((e=>e.isLast));function s(e,t){const n=function(e,t){const n=l(e);return[...e.versions.filter((e=>e!==n)),n].find((e=>!!(0,r.B6)(t,{path:e.path,exact:!1,strict:!1})))}(e,t),a=n?.docs.find((e=>!!(0,r.B6)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:a,alternateDocVersions:a?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(a.id):{}}}const u={},c=()=>i("docusaurus-plugin-content-docs")??u,d=e=>{try{return function(e,t,n){void 0===t&&(t=o.W),void 0===n&&(n={});const r=i(e),a=r?.[t];if(!a&&n.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin with id "${t}".`);return a}("docusaurus-plugin-content-docs",e,{failfast:!0})}catch(t){throw new Error("You are using a feature of the Docusaurus docs plugin, but this plugin does not seem to be enabled"+("Default"===e?"":` (pluginId=${e}`),{cause:t})}};function f(e){void 0===e&&(e={});const t=c(),{pathname:n}=(0,r.zy)();return function(e,t,n){void 0===n&&(n={});const a=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.B6)(t,{path:n.path,exact:!1,strict:!1})})),o=a?{pluginId:a[0],pluginData:a[1]}:void 0;if(!o&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return o}(t,n,e)}function p(e){return d(e).versions}function m(e){const t=d(e);return l(t)}function g(e){const t=d(e),{pathname:n}=(0,r.zy)();return s(t,n)}function h(e){const t=d(e),{pathname:n}=(0,r.zy)();return function(e,t){const n=l(e);return{latestDocSuggestion:s(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},6294:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(5947),a=n.n(r);a().configure({showSpinner:!1});const o={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{a().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){a().done()}}},6134:(e,t,n)=>{"use strict";var r=n(1765),a=n(4784);!function(e){const{themeConfig:{prism:t}}=a.default,{additionalLanguages:r}=t;globalThis.Prism=e,r.forEach((e=>{"php"===e&&n(9700),n(3890)(`./prism-${e}`)})),delete globalThis.Prism}(r.My)},1107:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});n(6540);var r=n(4164),a=n(1312),o=n(6342),i=n(8774),l=n(3427);const s={anchorWithStickyNavbar:"anchorWithStickyNavbar_LWe7",anchorWithHideOnScrollNavbar:"anchorWithHideOnScrollNavbar_WYt5"};var u=n(4848);function c(e){let{as:t,id:n,...c}=e;const d=(0,l.A)(),{navbar:{hideOnScroll:f}}=(0,o.p)();if("h1"===t||!n)return(0,u.jsx)(t,{...c,id:void 0});d.collectAnchor(n);const p=(0,a.T)({id:"theme.common.headingLinkTitle",message:"Direct link to {heading}",description:"Title for link to heading"},{heading:"string"==typeof c.children?c.children:n});return(0,u.jsxs)(t,{...c,className:(0,r.A)("anchor",f?s.anchorWithHideOnScrollNavbar:s.anchorWithStickyNavbar,c.className),id:n,children:[c.children,(0,u.jsx)(i.A,{className:"hash-link",to:`#${n}`,"aria-label":p,title:p,children:"\u200b"})]})}},3186:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);const r={iconExternalLink:"iconExternalLink_nPIU"};var a=n(4848);function o(e){let{width:t=13.5,height:n=13.5}=e;return(0,a.jsx)("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:r.iconExternalLink,children:(0,a.jsx)("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"})})}},781:(e,t,n)=>{"use strict";n.d(t,{A:()=>pt});var r=n(6540),a=n(4164),o=n(7489),i=n(1003),l=n(6347),s=n(1312),u=n(5062),c=n(4848);const d="__docusaurus_skipToContent_fallback";function f(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function p(){const e=(0,r.useRef)(null),{action:t}=(0,l.W6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(d);t&&f(t)}),[]);return(0,u.$)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&f(e.current)})),{containerRef:e,onClick:n}}const m=(0,s.T)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function g(e){const t=e.children??m,{containerRef:n,onClick:r}=p();return(0,c.jsx)("div",{ref:n,role:"region","aria-label":m,children:(0,c.jsx)("a",{...e,href:`#${d}`,onClick:r,children:t})})}var h=n(7559),y=n(4090);const b={skipToContent:"skipToContent_fXgn"};function v(){return(0,c.jsx)(g,{className:b.skipToContent})}var w=n(6342),k=n(5041);function x(e){let{width:t=21,height:n=21,color:r="currentColor",strokeWidth:a=1.2,className:o,...i}=e;return(0,c.jsx)("svg",{viewBox:"0 0 15 15",width:t,height:n,...i,children:(0,c.jsx)("g",{stroke:r,strokeWidth:a,children:(0,c.jsx)("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})})})}const S={closeButton:"closeButton_CVFx"};function E(e){return(0,c.jsx)("button",{type:"button","aria-label":(0,s.T)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"}),...e,className:(0,a.A)("clean-btn close",S.closeButton,e.className),children:(0,c.jsx)(x,{width:14,height:14,strokeWidth:3.1})})}const C={content:"content_knG7"};function _(e){const{announcementBar:t}=(0,w.p)(),{content:n}=t;return(0,c.jsx)("div",{...e,className:(0,a.A)(C.content,e.className),dangerouslySetInnerHTML:{__html:n}})}const A={announcementBar:"announcementBar_mb4j",announcementBarPlaceholder:"announcementBarPlaceholder_vyr4",announcementBarClose:"announcementBarClose_gvF7",announcementBarContent:"announcementBarContent_xLdY"};function T(){const{announcementBar:e}=(0,w.p)(),{isActive:t,close:n}=(0,k.M)();if(!t)return null;const{backgroundColor:r,textColor:a,isCloseable:o}=e;return(0,c.jsxs)("div",{className:A.announcementBar,style:{backgroundColor:r,color:a},role:"banner",children:[o&&(0,c.jsx)("div",{className:A.announcementBarPlaceholder}),(0,c.jsx)(_,{className:A.announcementBarContent}),o&&(0,c.jsx)(E,{onClick:n,className:A.announcementBarClose})]})}var N=n(9876),j=n(3104);var L=n(9532),P=n(5600);const O=r.createContext(null);function R(e){let{children:t}=e;const n=function(){const e=(0,N.M)(),t=(0,P.YL)(),[n,a]=(0,r.useState)(!1),o=null!==t.component,i=(0,L.ZC)(o);return(0,r.useEffect)((()=>{o&&!i&&a(!0)}),[o,i]),(0,r.useEffect)((()=>{o?e.shown||a(!0):a(!1)}),[e.shown,o]),(0,r.useMemo)((()=>[n,a]),[n])}();return(0,c.jsx)(O.Provider,{value:n,children:t})}function I(e){if(e.component){const t=e.component;return(0,c.jsx)(t,{...e.props})}}function F(){const e=(0,r.useContext)(O);if(!e)throw new L.dV("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,a=(0,r.useCallback)((()=>n(!1)),[n]),o=(0,P.YL)();return(0,r.useMemo)((()=>({shown:t,hide:a,content:I(o)})),[a,o,t])}function M(e){let{header:t,primaryMenu:n,secondaryMenu:r}=e;const{shown:o}=F();return(0,c.jsxs)("div",{className:"navbar-sidebar",children:[t,(0,c.jsxs)("div",{className:(0,a.A)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":o}),children:[(0,c.jsx)("div",{className:"navbar-sidebar__item menu",children:n}),(0,c.jsx)("div",{className:"navbar-sidebar__item menu",children:r})]})]})}var D=n(5293),z=n(2303);function B(e){return(0,c.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,c.jsx)("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"})})}function $(e){return(0,c.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,c.jsx)("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"})})}const U={toggle:"toggle_vylO",toggleButton:"toggleButton_gllP",darkToggleIcon:"darkToggleIcon_wfgR",lightToggleIcon:"lightToggleIcon_pyhR",toggleButtonDisabled:"toggleButtonDisabled_aARS"};function H(e){let{className:t,buttonClassName:n,value:r,onChange:o}=e;const i=(0,z.A)(),l=(0,s.T)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===r?(0,s.T)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,s.T)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return(0,c.jsx)("div",{className:(0,a.A)(U.toggle,t),children:(0,c.jsxs)("button",{className:(0,a.A)("clean-btn",U.toggleButton,!i&&U.toggleButtonDisabled,n),type:"button",onClick:()=>o("dark"===r?"light":"dark"),disabled:!i,title:l,"aria-label":l,"aria-live":"polite",children:[(0,c.jsx)(B,{className:(0,a.A)(U.toggleIcon,U.lightToggleIcon)}),(0,c.jsx)($,{className:(0,a.A)(U.toggleIcon,U.darkToggleIcon)})]})})}const V=r.memo(H),W={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_X3D1"};function q(e){let{className:t}=e;const n=(0,w.p)().navbar.style,r=(0,w.p)().colorMode.disableSwitch,{colorMode:a,setColorMode:o}=(0,D.G)();return r?null:(0,c.jsx)(V,{className:t,buttonClassName:"dark"===n?W.darkNavbarColorModeToggle:void 0,value:a,onChange:o})}var G=n(3465);function Y(){return(0,c.jsx)(G.A,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function Q(){const e=(0,N.M)();return(0,c.jsx)("button",{type:"button","aria-label":(0,s.T)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle(),children:(0,c.jsx)(x,{color:"var(--ifm-color-emphasis-600)"})})}function K(){return(0,c.jsxs)("div",{className:"navbar-sidebar__brand",children:[(0,c.jsx)(Y,{}),(0,c.jsx)(q,{className:"margin-right--md"}),(0,c.jsx)(Q,{})]})}var Z=n(8774),X=n(6025),J=n(6654);function ee(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}var te=n(3186);function ne(e){let{activeBasePath:t,activeBaseRegex:n,to:r,href:a,label:o,html:i,isDropdownLink:l,prependBaseUrlToHref:s,...u}=e;const d=(0,X.Ay)(r),f=(0,X.Ay)(t),p=(0,X.Ay)(a,{forcePrependBaseUrl:!0}),m=o&&a&&!(0,J.A)(a),g=i?{dangerouslySetInnerHTML:{__html:i}}:{children:(0,c.jsxs)(c.Fragment,{children:[o,m&&(0,c.jsx)(te.A,{...l&&{width:12,height:12}})]})};return a?(0,c.jsx)(Z.A,{href:s?p:a,...u,...g}):(0,c.jsx)(Z.A,{to:d,isNavLink:!0,...(t||n)&&{isActive:(e,t)=>n?ee(n,t.pathname):t.pathname.startsWith(f)},...u,...g})}function re(e){let{className:t,isDropdownItem:n=!1,...r}=e;const o=(0,c.jsx)(ne,{className:(0,a.A)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n,...r});return n?(0,c.jsx)("li",{children:o}):o}function ae(e){let{className:t,isDropdownItem:n,...r}=e;return(0,c.jsx)("li",{className:"menu__list-item",children:(0,c.jsx)(ne,{className:(0,a.A)("menu__link",t),...r})})}function oe(e){let{mobile:t=!1,position:n,...r}=e;const a=t?ae:re;return(0,c.jsx)(a,{...r,activeClassName:r.activeClassName??(t?"menu__link--active":"navbar__link--active")})}var ie=n(1422),le=n(9169),se=n(4586);const ue={dropdownNavbarItemMobile:"dropdownNavbarItemMobile_S0Fm"};function ce(e,t){return e.some((e=>function(e,t){return!!(0,le.ys)(e.to,t)||!!ee(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function de(e){let{items:t,position:n,className:o,onClick:i,...l}=e;const s=(0,r.useRef)(null),[u,d]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}}),[s]),(0,c.jsxs)("div",{ref:s,className:(0,a.A)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":u}),children:[(0,c.jsx)(ne,{"aria-haspopup":"true","aria-expanded":u,role:"button",href:l.to?void 0:"#",className:(0,a.A)("navbar__link",o),...l,onClick:l.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(!u))},children:l.children??l.label}),(0,c.jsx)("ul",{className:"dropdown__menu",children:t.map(((e,t)=>(0,r.createElement)(Ce,{isDropdownItem:!0,activeClassName:"dropdown__link--active",...e,key:t})))})]})}function fe(e){let{items:t,className:n,position:o,onClick:i,...s}=e;const u=function(){const{siteConfig:{baseUrl:e}}=(0,se.A)(),{pathname:t}=(0,l.zy)();return t.replace(e,"/")}(),d=ce(t,u),{collapsed:f,toggleCollapsed:p,setCollapsed:m}=(0,ie.u)({initialState:()=>!d});return(0,r.useEffect)((()=>{d&&m(!d)}),[u,d,m]),(0,c.jsxs)("li",{className:(0,a.A)("menu__list-item",{"menu__list-item--collapsed":f}),children:[(0,c.jsx)(ne,{role:"button",className:(0,a.A)(ue.dropdownNavbarItemMobile,"menu__link menu__link--sublist menu__link--sublist-caret",n),...s,onClick:e=>{e.preventDefault(),p()},children:s.children??s.label}),(0,c.jsx)(ie.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:f,children:t.map(((e,t)=>(0,r.createElement)(Ce,{mobile:!0,isDropdownItem:!0,onClick:i,activeClassName:"menu__link--active",...e,key:t})))})]})}function pe(e){let{mobile:t=!1,...n}=e;const r=t?fe:de;return(0,c.jsx)(r,{...n})}var me=n(2131);function ge(e){let{width:t=20,height:n=20,...r}=e;return(0,c.jsx)("svg",{viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0,...r,children:(0,c.jsx)("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"})})}const he="iconLanguage_nlXk";var ye=n(418);const be={navbarSearchContainer:"navbarSearchContainer_Bca1"};function ve(e){let{children:t,className:n}=e;return(0,c.jsx)("div",{className:(0,a.A)(n,be.navbarSearchContainer),children:t})}var we=n(4070),ke=n(1754);var xe=n(5597);const Se=e=>e.docs.find((t=>t.id===e.mainDocId));const Ee={default:oe,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:r,queryString:a="",...o}=e;const{i18n:{currentLocale:i,locales:u,localeConfigs:d}}=(0,se.A)(),f=(0,me.o)(),{search:p,hash:m}=(0,l.zy)(),g=[...n,...u.map((e=>{const n=`${`pathname://${f.createUrl({locale:e,fullyQualified:!1})}`}${p}${m}${a}`;return{label:d[e].label,lang:d[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===i?t?"menu__link--active":"dropdown__link--active":""}})),...r],h=t?(0,s.T)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):d[i].label;return(0,c.jsx)(pe,{...o,mobile:t,label:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(ge,{className:he}),h]}),items:g})},search:function(e){let{mobile:t,className:n}=e;return t?null:(0,c.jsx)(ve,{className:n,children:(0,c.jsx)(ye.A,{})})},dropdown:pe,html:function(e){let{value:t,className:n,mobile:r=!1,isDropdownItem:o=!1}=e;const i=o?"li":"div";return(0,c.jsx)(i,{className:(0,a.A)({navbar__item:!r&&!o,"menu__list-item":r},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:r,...a}=e;const{activeDoc:o}=(0,we.zK)(r),i=(0,ke.QB)(t,r),l=o?.path===i?.path;return null===i||i.unlisted&&!l?null:(0,c.jsx)(oe,{exact:!0,...a,isActive:()=>l||!!o?.sidebar&&o.sidebar===i.sidebar,label:n??i.id,to:i.path})},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:r,...a}=e;const{activeDoc:o}=(0,we.zK)(r),i=(0,ke.fW)(t,r).link;if(!i)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return(0,c.jsx)(oe,{exact:!0,...a,isActive:()=>o?.sidebar===t,label:n??i.label,to:i.path})},docsVersion:function(e){let{label:t,to:n,docsPluginId:r,...a}=e;const o=(0,ke.Vd)(r)[0],i=t??o.label,l=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(o).path;return(0,c.jsx)(oe,{...a,label:i,to:l})},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:r,dropdownItemsBefore:a,dropdownItemsAfter:o,...i}=e;const{search:u,hash:d}=(0,l.zy)(),f=(0,we.zK)(n),p=(0,we.jh)(n),{savePreferredVersionName:m}=(0,xe.g1)(n),g=[...a,...p.map((e=>{const t=f.alternateDocVersions[e.name]??Se(e);return{label:e.label,to:`${t.path}${u}${d}`,isActive:()=>e===f.activeVersion,onClick:()=>m(e.name)}})),...o],h=(0,ke.Vd)(n)[0],y=t&&g.length>1?(0,s.T)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):h.label,b=t&&g.length>1?void 0:Se(h).path;return g.length<=1?(0,c.jsx)(oe,{...i,mobile:t,label:y,to:b,isActive:r?()=>!1:void 0}):(0,c.jsx)(pe,{...i,mobile:t,label:y,to:b,items:g,isActive:r?()=>!1:void 0})}};function Ce(e){let{type:t,...n}=e;const r=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),a=Ee[r];if(!a)throw new Error(`No NavbarItem component found for type "${t}".`);return(0,c.jsx)(a,{...n})}function _e(){const e=(0,N.M)(),t=(0,w.p)().navbar.items;return(0,c.jsx)("ul",{className:"menu__list",children:t.map(((t,n)=>(0,r.createElement)(Ce,{mobile:!0,...t,onClick:()=>e.toggle(),key:n})))})}function Ae(e){return(0,c.jsx)("button",{...e,type:"button",className:"clean-btn navbar-sidebar__back",children:(0,c.jsx)(s.A,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)",children:"\u2190 Back to main menu"})})}function Te(){const e=0===(0,w.p)().navbar.items.length,t=F();return(0,c.jsxs)(c.Fragment,{children:[!e&&(0,c.jsx)(Ae,{onClick:()=>t.hide()}),t.content]})}function Ne(){const e=(0,N.M)();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?(0,c.jsx)(M,{header:(0,c.jsx)(K,{}),primaryMenu:(0,c.jsx)(_e,{}),secondaryMenu:(0,c.jsx)(Te,{})}):null}const je={navbarHideable:"navbarHideable_m1mJ",navbarHidden:"navbarHidden_jGov"};function Le(e){return(0,c.jsx)("div",{role:"presentation",...e,className:(0,a.A)("navbar-sidebar__backdrop",e.className)})}function Pe(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:o}}=(0,w.p)(),i=(0,N.M)(),{navbarRef:l,isNavbarVisible:d}=function(e){const[t,n]=(0,r.useState)(e),a=(0,r.useRef)(!1),o=(0,r.useRef)(0),i=(0,r.useCallback)((e=>{null!==e&&(o.current=e.getBoundingClientRect().height)}),[]);return(0,j.Mq)(((t,r)=>{let{scrollY:i}=t;if(!e)return;if(i=l?n(!1):i+u{if(!e)return;const r=t.location.hash;if(r?document.getElementById(r.substring(1)):void 0)return a.current=!0,void n(!1);n(!0)})),{navbarRef:i,isNavbarVisible:t}}(n);return(0,c.jsxs)("nav",{ref:l,"aria-label":(0,s.T)({id:"theme.NavBar.navAriaLabel",message:"Main",description:"The ARIA label for the main navigation"}),className:(0,a.A)("navbar","navbar--fixed-top",n&&[je.navbarHideable,!d&&je.navbarHidden],{"navbar--dark":"dark"===o,"navbar--primary":"primary"===o,"navbar-sidebar--show":i.shown}),children:[t,(0,c.jsx)(Le,{onClick:i.toggle}),(0,c.jsx)(Ne,{})]})}var Oe=n(440);const Re={errorBoundaryError:"errorBoundaryError_a6uf",errorBoundaryFallback:"errorBoundaryFallback_VBag"};function Ie(e){return(0,c.jsx)("button",{type:"button",...e,children:(0,c.jsx)(s.A,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again rendering when the React error boundary captures an error",children:"Try again"})})}function Fe(e){let{error:t}=e;const n=(0,Oe.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,c.jsx)("p",{className:Re.errorBoundaryError,children:n})}class Me extends r.Component{componentDidCatch(e,t){throw this.props.onError(e,t)}render(){return this.props.children}}const De="right";function ze(e){let{width:t=30,height:n=30,className:r,...a}=e;return(0,c.jsx)("svg",{className:r,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true",...a,children:(0,c.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"})})}function Be(){const{toggle:e,shown:t}=(0,N.M)();return(0,c.jsx)("button",{onClick:e,"aria-label":(0,s.T)({id:"theme.docs.sidebar.toggleSidebarButtonAriaLabel",message:"Toggle navigation bar",description:"The ARIA label for hamburger menu button of mobile navigation"}),"aria-expanded":t,className:"navbar__toggle clean-btn",type:"button",children:(0,c.jsx)(ze,{})})}const $e={colorModeToggle:"colorModeToggle_DEke"};function Ue(e){let{items:t}=e;return(0,c.jsx)(c.Fragment,{children:t.map(((e,t)=>(0,c.jsx)(Me,{onError:t=>new Error(`A theme navbar item failed to render.\nPlease double-check the following navbar item (themeConfig.navbar.items) of your Docusaurus config:\n${JSON.stringify(e,null,2)}`,{cause:t}),children:(0,c.jsx)(Ce,{...e})},t)))})}function He(e){let{left:t,right:n}=e;return(0,c.jsxs)("div",{className:"navbar__inner",children:[(0,c.jsx)("div",{className:"navbar__items",children:t}),(0,c.jsx)("div",{className:"navbar__items navbar__items--right",children:n})]})}function Ve(){const e=(0,N.M)(),t=(0,w.p)().navbar.items,[n,r]=function(e){function t(e){return"left"===(e.position??De)}return[e.filter(t),e.filter((e=>!t(e)))]}(t),a=t.find((e=>"search"===e.type));return(0,c.jsx)(He,{left:(0,c.jsxs)(c.Fragment,{children:[!e.disabled&&(0,c.jsx)(Be,{}),(0,c.jsx)(Y,{}),(0,c.jsx)(Ue,{items:n})]}),right:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ue,{items:r}),(0,c.jsx)(q,{className:$e.colorModeToggle}),!a&&(0,c.jsx)(ve,{children:(0,c.jsx)(ye.A,{})})]})})}function We(){return(0,c.jsx)(Pe,{children:(0,c.jsx)(Ve,{})})}function qe(e){let{item:t}=e;const{to:n,href:r,label:a,prependBaseUrlToHref:o,...i}=t,l=(0,X.Ay)(n),s=(0,X.Ay)(r,{forcePrependBaseUrl:!0});return(0,c.jsxs)(Z.A,{className:"footer__link-item",...r?{href:o?s:r}:{to:l},...i,children:[a,r&&!(0,J.A)(r)&&(0,c.jsx)(te.A,{})]})}function Ge(e){let{item:t}=e;return t.html?(0,c.jsx)("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):(0,c.jsx)("li",{className:"footer__item",children:(0,c.jsx)(qe,{item:t})},t.href??t.to)}function Ye(e){let{column:t}=e;return(0,c.jsxs)("div",{className:"col footer__col",children:[(0,c.jsx)("div",{className:"footer__title",children:t.title}),(0,c.jsx)("ul",{className:"footer__items clean-list",children:t.items.map(((e,t)=>(0,c.jsx)(Ge,{item:e},t)))})]})}function Qe(e){let{columns:t}=e;return(0,c.jsx)("div",{className:"row footer__links",children:t.map(((e,t)=>(0,c.jsx)(Ye,{column:e},t)))})}function Ke(){return(0,c.jsx)("span",{className:"footer__link-separator",children:"\xb7"})}function Ze(e){let{item:t}=e;return t.html?(0,c.jsx)("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):(0,c.jsx)(qe,{item:t})}function Xe(e){let{links:t}=e;return(0,c.jsx)("div",{className:"footer__links text--center",children:(0,c.jsx)("div",{className:"footer__links",children:t.map(((e,n)=>(0,c.jsxs)(r.Fragment,{children:[(0,c.jsx)(Ze,{item:e}),t.length!==n+1&&(0,c.jsx)(Ke,{})]},n)))})})}function Je(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?(0,c.jsx)(Qe,{columns:t}):(0,c.jsx)(Xe,{links:t})}var et=n(1122);const tt={footerLogoLink:"footerLogoLink_BH7S"};function nt(e){let{logo:t}=e;const{withBaseUrl:n}=(0,X.hH)(),r={light:n(t.src),dark:n(t.srcDark??t.src)};return(0,c.jsx)(et.A,{className:(0,a.A)("footer__logo",t.className),alt:t.alt,sources:r,width:t.width,height:t.height,style:t.style})}function rt(e){let{logo:t}=e;return t.href?(0,c.jsx)(Z.A,{href:t.href,className:tt.footerLogoLink,target:t.target,children:(0,c.jsx)(nt,{logo:t})}):(0,c.jsx)(nt,{logo:t})}function at(e){let{copyright:t}=e;return(0,c.jsx)("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function ot(e){let{style:t,links:n,logo:r,copyright:o}=e;return(0,c.jsx)("footer",{className:(0,a.A)("footer",{"footer--dark":"dark"===t}),children:(0,c.jsxs)("div",{className:"container container-fluid",children:[n,(r||o)&&(0,c.jsxs)("div",{className:"footer__bottom text--center",children:[r&&(0,c.jsx)("div",{className:"margin-bottom--sm",children:r}),o]})]})})}function it(){const{footer:e}=(0,w.p)();if(!e)return null;const{copyright:t,links:n,logo:r,style:a}=e;return(0,c.jsx)(ot,{style:a,links:n&&n.length>0&&(0,c.jsx)(Je,{links:n}),logo:r&&(0,c.jsx)(rt,{logo:r}),copyright:t&&(0,c.jsx)(at,{copyright:t})})}const lt=r.memo(it),st=(0,L.fM)([D.a,k.o,j.Tv,xe.VQ,i.Jx,function(e){let{children:t}=e;return(0,c.jsx)(P.y_,{children:(0,c.jsx)(N.e,{children:(0,c.jsx)(R,{children:t})})})}]);function ut(e){let{children:t}=e;return(0,c.jsx)(st,{children:t})}var ct=n(1107);function dt(e){let{error:t,tryAgain:n}=e;return(0,c.jsx)("main",{className:"container margin-vert--xl",children:(0,c.jsx)("div",{className:"row",children:(0,c.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,c.jsx)(ct.A,{as:"h1",className:"hero__title",children:(0,c.jsx)(s.A,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed",children:"This page crashed."})}),(0,c.jsx)("div",{className:"margin-vert--lg",children:(0,c.jsx)(Ie,{onClick:n,className:"button button--primary shadow--lw"})}),(0,c.jsx)("hr",{}),(0,c.jsx)("div",{className:"margin-vert--md",children:(0,c.jsx)(Fe,{error:t})})]})})})}const ft={mainWrapper:"mainWrapper_z2l0"};function pt(e){const{children:t,noFooter:n,wrapperClassName:r,title:l,description:s}=e;return(0,y.J)(),(0,c.jsxs)(ut,{children:[(0,c.jsx)(i.be,{title:l,description:s}),(0,c.jsx)(v,{}),(0,c.jsx)(T,{}),(0,c.jsx)(We,{}),(0,c.jsx)("div",{id:d,className:(0,a.A)(h.G.wrapper.main,ft.mainWrapper,r),children:(0,c.jsx)(o.A,{fallback:e=>(0,c.jsx)(dt,{...e}),children:t})}),!n&&(0,c.jsx)(lt,{})]})}},3465:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});n(6540);var r=n(8774),a=n(6025),o=n(4586),i=n(6342),l=n(1122),s=n(4848);function u(e){let{logo:t,alt:n,imageClassName:r}=e;const o={light:(0,a.Ay)(t.src),dark:(0,a.Ay)(t.srcDark||t.src)},i=(0,s.jsx)(l.A,{className:t.className,sources:o,height:t.height,width:t.width,alt:n,style:t.style});return r?(0,s.jsx)("div",{className:r,children:i}):i}function c(e){const{siteConfig:{title:t}}=(0,o.A)(),{navbar:{title:n,logo:l}}=(0,i.p)(),{imageClassName:c,titleClassName:d,...f}=e,p=(0,a.Ay)(l?.href||"/"),m=n?"":t,g=l?.alt??m;return(0,s.jsxs)(r.A,{to:p,...f,...l?.target&&{target:l.target},children:[l&&(0,s.jsx)(u,{logo:l,alt:g,imageClassName:c}),null!=n&&(0,s.jsx)("b",{className:d,children:n})]})}},1463:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);var r=n(5260),a=n(4848);function o(e){let{locale:t,version:n,tag:o}=e;const i=t;return(0,a.jsxs)(r.A,{children:[t&&(0,a.jsx)("meta",{name:"docusaurus_locale",content:t}),n&&(0,a.jsx)("meta",{name:"docusaurus_version",content:n}),o&&(0,a.jsx)("meta",{name:"docusaurus_tag",content:o}),i&&(0,a.jsx)("meta",{name:"docsearch:language",content:i}),n&&(0,a.jsx)("meta",{name:"docsearch:version",content:n}),o&&(0,a.jsx)("meta",{name:"docsearch:docusaurus_tag",content:o})]})}},1122:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(6540),a=n(4164),o=n(2303),i=n(5293);const l={themedComponent:"themedComponent_mlkZ","themedComponent--light":"themedComponent--light_NVdE","themedComponent--dark":"themedComponent--dark_xIcU"};var s=n(4848);function u(e){let{className:t,children:n}=e;const u=(0,o.A)(),{colorMode:c}=(0,i.G)();return(0,s.jsx)(s.Fragment,{children:(u?"dark"===c?["dark"]:["light"]:["light","dark"]).map((e=>{const o=n({theme:e,className:(0,a.A)(t,l.themedComponent,l[`themedComponent--${e}`])});return(0,s.jsx)(r.Fragment,{children:o},e)}))})}function c(e){const{sources:t,className:n,alt:r,...a}=e;return(0,s.jsx)(u,{className:n,children:e=>{let{theme:n,className:o}=e;return(0,s.jsx)("img",{src:t[n],alt:r,className:o,...a})}})}},1422:(e,t,n)=>{"use strict";n.d(t,{N:()=>y,u:()=>u});var r=n(6540),a=n(8193),o=n(205),i=n(3109),l=n(4848);const s="ease-in-out";function u(e){let{initialState:t}=e;const[n,a]=(0,r.useState)(t??!1),o=(0,r.useCallback)((()=>{a((e=>!e))}),[]);return{collapsed:n,setCollapsed:a,toggleCollapsed:o}}const c={display:"none",overflow:"hidden",height:"0px"},d={display:"block",overflow:"visible",height:"auto"};function f(e,t){const n=t?c:d;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function p(e){let{collapsibleRef:t,collapsed:n,animation:a}=e;const o=(0,r.useRef)(!1);(0,r.useEffect)((()=>{const e=t.current;function r(){const t=e.scrollHeight,n=a?.duration??function(e){if((0,i.O)())return 1;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}(t);return{transition:`height ${n}ms ${a?.easing??s}`,height:`${t}px`}}function l(){const t=r();e.style.transition=t.transition,e.style.height=t.height}if(!o.current)return f(e,n),void(o.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(l(),requestAnimationFrame((()=>{e.style.height=c.height,e.style.overflow=c.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{l()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,a])}function m(e){if(!a.A.canUseDOM)return e?c:d}function g(e){let{as:t="div",collapsed:n,children:a,animation:o,onCollapseTransitionEnd:i,className:s,disableSSRStyle:u}=e;const c=(0,r.useRef)(null);return p({collapsibleRef:c,collapsed:n,animation:o}),(0,l.jsx)(t,{ref:c,style:u?void 0:m(n),onTransitionEnd:e=>{"height"===e.propertyName&&(f(c.current,n),i?.(n))},className:s,children:a})}function h(e){let{collapsed:t,...n}=e;const[a,i]=(0,r.useState)(!t),[s,u]=(0,r.useState)(t);return(0,o.A)((()=>{t||i(!0)}),[t]),(0,o.A)((()=>{a&&u(t)}),[a,t]),a?(0,l.jsx)(g,{...n,collapsed:s}):null}function y(e){let{lazy:t,...n}=e;const r=t?h:g;return(0,l.jsx)(r,{...n})}},5041:(e,t,n)=>{"use strict";n.d(t,{M:()=>g,o:()=>m});var r=n(6540),a=n(2303),o=n(679),i=n(9532),l=n(6342),s=n(4848);const u=(0,o.Wf)("docusaurus.announcement.dismiss"),c=(0,o.Wf)("docusaurus.announcement.id"),d=()=>"true"===u.get(),f=e=>u.set(String(e)),p=r.createContext(null);function m(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,l.p)(),t=(0,a.A)(),[n,o]=(0,r.useState)((()=>!!t&&d()));(0,r.useEffect)((()=>{o(d())}),[]);const i=(0,r.useCallback)((()=>{f(!0),o(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=c.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;c.set(t),r&&f(!1),!r&&d()||o(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:i})),[e,n,i])}();return(0,s.jsx)(p.Provider,{value:n,children:t})}function g(){const e=(0,r.useContext)(p);if(!e)throw new i.dV("AnnouncementBarProvider");return e}},5293:(e,t,n)=>{"use strict";n.d(t,{G:()=>y,a:()=>h});var r=n(6540),a=n(8193),o=n(9532),i=n(679),l=n(6342),s=n(4848);const u=r.createContext(void 0),c="theme",d=(0,i.Wf)(c),f={light:"light",dark:"dark"},p=e=>e===f.dark?f.dark:f.light,m=e=>a.A.canUseDOM?p(document.documentElement.getAttribute("data-theme")):p(e),g=e=>{d.set(p(e))};function h(e){let{children:t}=e;const n=function(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,l.p)(),[a,o]=(0,r.useState)(m(e));(0,r.useEffect)((()=>{t&&d.del()}),[t]);const i=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:a=!0}=r;t?(o(t),a&&g(t)):(o(n?window.matchMedia("(prefers-color-scheme: dark)").matches?f.dark:f.light:e),d.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",p(a))}),[a]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==c)return;const t=d.get();null!==t&&i(p(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,i]);const s=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||s.current?s.current=window.matchMedia("print").matches:i(null)};return e.addListener(r),()=>e.removeListener(r)}),[i,t,n]),(0,r.useMemo)((()=>({colorMode:a,setColorMode:i,get isDarkTheme(){return a===f.dark},setLightTheme(){i(f.light)},setDarkTheme(){i(f.dark)}})),[a,i])}();return(0,s.jsx)(u.Provider,{value:n,children:t})}function y(){const e=(0,r.useContext)(u);if(null==e)throw new o.dV("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},5597:(e,t,n)=>{"use strict";n.d(t,{VQ:()=>y,g1:()=>v});var r=n(6540),a=n(4070),o=n(7065),i=n(6342),l=n(1754),s=n(9532),u=n(679),c=n(4848);const d=e=>`docs-preferred-version-${e}`,f={save:(e,t,n)=>{(0,u.Wf)(d(e),{persistence:t}).set(n)},read:(e,t)=>(0,u.Wf)(d(e),{persistence:t}).get(),clear:(e,t)=>{(0,u.Wf)(d(e),{persistence:t}).del()}},p=e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}])));const m=r.createContext(null);function g(){const e=(0,a.Gy)(),t=(0,i.p)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[o,l]=(0,r.useState)((()=>p(n)));(0,r.useEffect)((()=>{l(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function a(e){const t=f.read(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(f.clear(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,a(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[o,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){f.save(e,t,n),l((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function h(e){let{children:t}=e;const n=g();return(0,c.jsx)(m.Provider,{value:n,children:t})}function y(e){let{children:t}=e;return l.C5?(0,c.jsx)(h,{children:t}):(0,c.jsx)(c.Fragment,{children:t})}function b(){const e=(0,r.useContext)(m);if(!e)throw new s.dV("DocsPreferredVersionContextProvider");return e}function v(e){void 0===e&&(e=o.W);const t=(0,a.ht)(e),[n,i]=b(),{preferredVersionName:l}=n[e];return{preferredVersion:t.versions.find((e=>e.name===l))??null,savePreferredVersionName:(0,r.useCallback)((t=>{i.savePreferredVersion(e,t)}),[i,e])}}},6588:(e,t,n)=>{"use strict";n.d(t,{V:()=>s,t:()=>u});var r=n(6540),a=n(9532),o=n(4848);const i=Symbol("EmptyContext"),l=r.createContext(i);function s(e){let{children:t,name:n,items:a}=e;const i=(0,r.useMemo)((()=>n&&a?{name:n,items:a}:null),[n,a]);return(0,o.jsx)(l.Provider,{value:i,children:t})}function u(){const e=(0,r.useContext)(l);if(e===i)throw new a.dV("DocsSidebarProvider");return e}},2252:(e,t,n)=>{"use strict";n.d(t,{n:()=>l,r:()=>s});var r=n(6540),a=n(9532),o=n(4848);const i=r.createContext(null);function l(e){let{children:t,version:n}=e;return(0,o.jsx)(i.Provider,{value:n,children:t})}function s(){const e=(0,r.useContext)(i);if(null===e)throw new a.dV("DocsVersionProvider");return e}},9876:(e,t,n)=>{"use strict";n.d(t,{e:()=>p,M:()=>m});var r=n(6540),a=n(5600),o=n(4581),i=n(6347),l=n(9532);function s(e){!function(e){const t=(0,i.W6)(),n=(0,l._q)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}var u=n(6342),c=n(4848);const d=r.createContext(void 0);function f(){const e=function(){const e=(0,a.YL)(),{items:t}=(0,u.p)().navbar;return 0===t.length&&!e.component}(),t=(0,o.l)(),n=!e&&"mobile"===t,[i,l]=(0,r.useState)(!1);s((()=>{if(i)return l(!1),!1}));const c=(0,r.useCallback)((()=>{l((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&l(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:c,shown:i})),[e,n,c,i])}function p(e){let{children:t}=e;const n=f();return(0,c.jsx)(d.Provider,{value:n,children:t})}function m(){const e=r.useContext(d);if(void 0===e)throw new l.dV("NavbarMobileSidebarProvider");return e}},5600:(e,t,n)=>{"use strict";n.d(t,{GX:()=>u,YL:()=>s,y_:()=>l});var r=n(6540),a=n(9532),o=n(4848);const i=r.createContext(null);function l(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return(0,o.jsx)(i.Provider,{value:n,children:t})}function s(){const e=(0,r.useContext)(i);if(!e)throw new a.dV("NavbarSecondaryMenuContentProvider");return e[0]}function u(e){let{component:t,props:n}=e;const o=(0,r.useContext)(i);if(!o)throw new a.dV("NavbarSecondaryMenuContentProvider");const[,l]=o,s=(0,a.Be)(n);return(0,r.useEffect)((()=>{l({component:t,props:s})}),[l,t,s]),(0,r.useEffect)((()=>()=>l({component:null,props:null})),[l]),null}},4090:(e,t,n)=>{"use strict";n.d(t,{w:()=>a,J:()=>o});var r=n(6540);const a="navigation-with-keyboard";function o(){(0,r.useEffect)((()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(a),"mousedown"===e.type&&document.body.classList.remove(a)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(a),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},4581:(e,t,n)=>{"use strict";n.d(t,{l:()=>l});var r=n(6540),a=n(8193);const o={desktop:"desktop",mobile:"mobile",ssr:"ssr"},i=996;function l(e){let{desktopBreakpoint:t=i}=void 0===e?{}:e;const[n,l]=(0,r.useState)((()=>"ssr"));return(0,r.useEffect)((()=>{function e(){l(function(e){if(!a.A.canUseDOM)throw new Error("getWindowSize() should only be called after React hydration");return window.innerWidth>e?o.desktop:o.mobile}(t))}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[t]),n}},7559:(e,t,n)=>{"use strict";n.d(t,{G:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",unlistedBanner:"theme-unlisted-banner",admonitionType:e=>`theme-admonition-${e}`},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{blogFooterTagsRow:"theme-blog-footer-tags-row",blogFooterEditMetaRow:"theme-blog-footer-edit-meta-row"},pages:{pageFooterEditMetaRow:"theme-pages-footer-edit-meta-row"}}},3109:(e,t,n)=>{"use strict";function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}n.d(t,{O:()=>r})},1754:(e,t,n)=>{"use strict";n.d(t,{d1:()=>A,Nr:()=>m,w8:()=>b,C5:()=>f,$S:()=>g,cC:()=>p,B5:()=>_,Vd:()=>S,QB:()=>C,fW:()=>E,OF:()=>x,Y:()=>w});var r=n(6540),a=n(6347),o=n(2831),i=n(4070),l=n(5597),s=n(2252),u=n(6588);function c(e){return Array.from(new Set(e))}var d=n(9169);const f=!!i.Gy;function p(e){const t=(0,s.r)();if(!e)return;const n=t.docs[e];if(!n)throw new Error(`no version doc found by id=${e}`);return n}function m(e){return"link"!==e.type||e.unlisted?"category"===e.type?function(e){if(e.href&&!e.linkUnlisted)return e.href;for(const t of e.items){const e=m(t);if(e)return e}}(e):void 0:e.href}function g(){const{pathname:e}=(0,a.zy)(),t=(0,u.t)();if(!t)throw new Error("Unexpected: cant find current sidebar in context");const n=k({sidebarItems:t.items,pathname:e,onlyCategories:!0}).slice(-1)[0];if(!n)throw new Error(`${e} is not associated with a category. useCurrentSidebarCategory() should only be used on category index pages.`);return n}const h=(e,t)=>void 0!==e&&(0,d.ys)(e,t),y=(e,t)=>e.some((e=>b(e,t)));function b(e,t){return"link"===e.type?h(e.href,t):"category"===e.type&&(h(e.href,t)||y(e.items,t))}function v(e,t){switch(e.type){case"category":return b(e,t)||e.items.some((e=>v(e,t)));case"link":return!e.unlisted||b(e,t);default:return!0}}function w(e,t){return(0,r.useMemo)((()=>e.filter((e=>v(e,t)))),[e,t])}function k(e){let{sidebarItems:t,pathname:n,onlyCategories:r=!1}=e;const a=[];return function e(t){for(const o of t)if("category"===o.type&&((0,d.ys)(o.href,n)||e(o.items))||"link"===o.type&&(0,d.ys)(o.href,n)){return r&&"category"!==o.type||a.unshift(o),!0}return!1}(t),a}function x(){const e=(0,u.t)(),{pathname:t}=(0,a.zy)(),n=(0,i.vT)()?.pluginData.breadcrumbs;return!1!==n&&e?k({sidebarItems:e.items,pathname:t}):null}function S(e){const{activeVersion:t}=(0,i.zK)(e),{preferredVersion:n}=(0,l.g1)(e),a=(0,i.r7)(e);return(0,r.useMemo)((()=>c([t,n,a].filter(Boolean))),[t,n,a])}function E(e,t){const n=S(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable sidebar ids are:\n- ${t.map((e=>e[0])).join("\n- ")}`);return r[1]}),[e,n])}function C(e,t){const n=S(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>e.draftIds)).includes(e))return null;throw new Error(`Couldn't find any doc with id "${e}" in version${n.length>1?"s":""} "${n.map((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${c(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function _(e){let{route:t}=e;const n=(0,a.zy)(),r=(0,s.r)(),i=t.routes,l=i.find((e=>(0,a.B6)(n.pathname,e)));if(!l)return null;const u=l.sidebar,c=u?r.docsSidebars[u]:void 0;return{docElement:(0,o.v)(i),sidebarName:u,sidebarItems:c}}function A(e){return e.filter((e=>!("category"===e.type||"link"===e.type)||!!m(e)))}},1003:(e,t,n)=>{"use strict";n.d(t,{e3:()=>p,be:()=>d,Jx:()=>m});var r=n(6540),a=n(4164),o=n(5260),i=n(3102);function l(){const e=r.useContext(i.o);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var s=n(6025),u=n(4586);var c=n(4848);function d(e){let{title:t,description:n,keywords:r,image:a,children:i}=e;const l=function(e){const{siteConfig:t}=(0,u.A)(),{title:n,titleDelimiter:r}=t;return e?.trim().length?`${e.trim()} ${r} ${n}`:n}(t),{withBaseUrl:d}=(0,s.hH)(),f=a?d(a,{absolute:!0}):void 0;return(0,c.jsxs)(o.A,{children:[t&&(0,c.jsx)("title",{children:l}),t&&(0,c.jsx)("meta",{property:"og:title",content:l}),n&&(0,c.jsx)("meta",{name:"description",content:n}),n&&(0,c.jsx)("meta",{property:"og:description",content:n}),r&&(0,c.jsx)("meta",{name:"keywords",content:Array.isArray(r)?r.join(","):r}),f&&(0,c.jsx)("meta",{property:"og:image",content:f}),f&&(0,c.jsx)("meta",{name:"twitter:image",content:f}),i]})}const f=r.createContext(void 0);function p(e){let{className:t,children:n}=e;const i=r.useContext(f),l=(0,a.A)(i,t);return(0,c.jsxs)(f.Provider,{value:l,children:[(0,c.jsx)(o.A,{children:(0,c.jsx)("html",{className:l})}),n]})}function m(e){let{children:t}=e;const n=l(),r=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const o=`plugin-id-${n.plugin.id}`;return(0,c.jsx)(p,{className:(0,a.A)(r,o),children:t})}},9532:(e,t,n)=>{"use strict";n.d(t,{Be:()=>u,ZC:()=>l,_q:()=>i,dV:()=>s,fM:()=>c});var r=n(6540),a=n(205),o=n(4848);function i(e){const t=(0,r.useRef)(e);return(0,a.A)((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function l(e){const t=(0,r.useRef)();return(0,a.A)((()=>{t.current=e})),t.current}class s extends Error{constructor(e,t){super(),this.name="ReactContextError",this.message=`Hook ${this.stack?.split("\n")[1]?.match(/at (?:\w+\.)?(?\w+)/)?.groups.name??""} is called outside the <${e}>. ${t??""}`}}function u(e){const t=Object.entries(e);return t.sort(((e,t)=>e[0].localeCompare(t[0]))),(0,r.useMemo)((()=>e),t.flat())}function c(e){return t=>{let{children:n}=t;return(0,o.jsx)(o.Fragment,{children:e.reduceRight(((e,t)=>(0,o.jsx)(t,{children:e})),n)})}}},9169:(e,t,n)=>{"use strict";n.d(t,{Dt:()=>l,ys:()=>i});var r=n(6540),a=n(8328),o=n(4586);function i(e,t){const n=e=>(!e||e.endsWith("/")?e:`${e}/`)?.toLowerCase();return n(e)===n(t)}function l(){const{baseUrl:e}=(0,o.A)().siteConfig;return(0,r.useMemo)((()=>function(e){let{baseUrl:t,routes:n}=e;function r(e){return e.path===t&&!0===e.exact}function a(e){return e.path===t&&!e.exact}return function e(t){if(0===t.length)return;return t.find(r)||e(t.filter(a).flatMap((e=>e.routes??[])))}(n)}({routes:a.A,baseUrl:e})),[e])}},3104:(e,t,n)=>{"use strict";n.d(t,{Mq:()=>f,Tv:()=>u,gk:()=>p});var r=n(6540),a=n(8193),o=n(2303),i=(n(205),n(9532)),l=n(4848);const s=r.createContext(void 0);function u(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return(0,l.jsx)(s.Provider,{value:n,children:t})}function c(){const e=(0,r.useContext)(s);if(null==e)throw new i.dV("ScrollControllerProvider");return e}const d=()=>a.A.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function f(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=c(),a=(0,r.useRef)(d()),o=(0,i._q)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=d();o(e,a.current),a.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[o,n,...t])}function p(){const e=(0,r.useRef)(null),t=(0,o.A)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:n=>{e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),()=>{}}(n):function(e){let t=null;const n=document.documentElement.scrollTop>e;return function r(){const a=document.documentElement.scrollTop;(n&&a>e||!n&&at&&cancelAnimationFrame(t)}(n)},cancelScroll:()=>e.current?.()}}},2967:(e,t,n)=>{"use strict";n.d(t,{Cy:()=>r,tU:()=>a});n(4586);const r="default";function a(e,t){return`docs-${e}-${t}`}},679:(e,t,n)=>{"use strict";n.d(t,{Wf:()=>u});n(6540);const r=JSON.parse('{"N":"localStorage","M":""}'),a=r.N;function o(e){let{key:t,oldValue:n,newValue:r,storage:a}=e;if(n===r)return;const o=document.createEvent("StorageEvent");o.initStorageEvent("storage",!1,!1,t,n,r,window.location.href,a),window.dispatchEvent(o)}function i(e){if(void 0===e&&(e=a),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,l||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),l=!0),null}var t}let l=!1;const s={get:()=>null,set:()=>{},del:()=>{},listen:()=>()=>{}};function u(e,t){const n=`${e}${r.M}`;if("undefined"==typeof window)return function(e){function t(){throw new Error(`Illegal storage API usage for storage key "${e}".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.`)}return{get:t,set:t,del:t,listen:t}}(n);const a=i(t?.persistence);return null===a?s:{get:()=>{try{return a.getItem(n)}catch(e){return console.error(`Docusaurus storage error, can't get key=${n}`,e),null}},set:e=>{try{const t=a.getItem(n);a.setItem(n,e),o({key:n,oldValue:t,newValue:e,storage:a})}catch(t){console.error(`Docusaurus storage error, can't set ${n}=${e}`,t)}},del:()=>{try{const e=a.getItem(n);a.removeItem(n),o({key:n,oldValue:e,newValue:null,storage:a})}catch(e){console.error(`Docusaurus storage error, can't delete key=${n}`,e)}},listen:e=>{try{const t=t=>{t.storageArea===a&&t.key===n&&e(t)};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)}catch(t){return console.error(`Docusaurus storage error, can't listen for changes of key=${n}`,t),()=>{}}}}}},2131:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var r=n(4586),a=n(6347),o=n(440);function i(){const{siteConfig:{baseUrl:e,url:t,trailingSlash:n},i18n:{defaultLocale:i,currentLocale:l}}=(0,r.A)(),{pathname:s}=(0,a.zy)(),u=(0,o.applyTrailingSlash)(s,{trailingSlash:n,baseUrl:e}),c=l===i?e:e.replace(`/${l}/`,"/"),d=u.replace(e,"");return{createUrl:function(e){let{locale:n,fullyQualified:r}=e;return`${r?t:""}${function(e){return e===i?`${c}`:`${c}${e}/`}(n)}${d}`}}}},5062:(e,t,n)=>{"use strict";n.d(t,{$:()=>i});var r=n(6540),a=n(6347),o=n(9532);function i(e){const t=(0,a.zy)(),n=(0,o.ZC)(t),i=(0,o._q)(e);(0,r.useEffect)((()=>{n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},6342:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var r=n(4586);function a(){return(0,r.A)().siteConfig.themeConfig}},2983:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeTrailingSlash=t.addLeadingSlash=t.addTrailingSlash=void 0;const r=n(2566);function a(e){return e.endsWith("/")?e:`${e}/`}function o(e){return(0,r.removeSuffix)(e,"/")}t.addTrailingSlash=a,t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[i]=e.split(/[#?]/),l="/"===i||i===r?i:(s=i,n?a(s):o(s));var s;return e.replace(i,l)},t.addLeadingSlash=function(e){return(0,r.addPrefix)(e,"/")},t.removeTrailingSlash=o},253:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=void 0,t.getErrorCausalChain=function e(t){return t.cause?[t,...e(t.cause)]:[t]}},440:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=t.removePrefix=t.addSuffix=t.removeSuffix=t.addPrefix=t.removeTrailingSlash=t.addLeadingSlash=t.addTrailingSlash=t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="__blog-post-container";var a=n(2983);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(a).default}}),Object.defineProperty(t,"addTrailingSlash",{enumerable:!0,get:function(){return a.addTrailingSlash}}),Object.defineProperty(t,"addLeadingSlash",{enumerable:!0,get:function(){return a.addLeadingSlash}}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return a.removeTrailingSlash}});var o=n(2566);Object.defineProperty(t,"addPrefix",{enumerable:!0,get:function(){return o.addPrefix}}),Object.defineProperty(t,"removeSuffix",{enumerable:!0,get:function(){return o.removeSuffix}}),Object.defineProperty(t,"addSuffix",{enumerable:!0,get:function(){return o.addSuffix}}),Object.defineProperty(t,"removePrefix",{enumerable:!0,get:function(){return o.removePrefix}});var i=n(253);Object.defineProperty(t,"getErrorCausalChain",{enumerable:!0,get:function(){return i.getErrorCausalChain}})},2566:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removePrefix=t.addSuffix=t.removeSuffix=t.addPrefix=void 0,t.addPrefix=function(e,t){return e.startsWith(t)?e:`${t}${e}`},t.removeSuffix=function(e,t){return""===t?e:e.endsWith(t)?e.slice(0,-t.length):e},t.addSuffix=function(e,t){return e.endsWith(t)?e:`${e}${t}`},t.removePrefix=function(e,t){return e.startsWith(t)?e.slice(t.length):e}},1513:(e,t,n)=>{"use strict";n.d(t,{zR:()=>w,TM:()=>_,yJ:()=>p,sC:()=>T,AO:()=>f});var r=n(8168);function a(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,a=e.length;r=0;f--){var p=i[f];"."===p?o(i,f):".."===p?(o(i,f),d++):d&&(o(i,f),d--)}if(!u)for(;d--;d)i.unshift("..");!u||""===i[0]||i[0]&&a(i[0])||i.unshift("");var m=i.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};var l=n(1561);function s(e){return"/"===e.charAt(0)?e:"/"+e}function u(e){return"/"===e.charAt(0)?e.substr(1):e}function c(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function f(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function p(e,t,n,a){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=(0,r.A)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(l){throw l instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):l}return n&&(o.key=n),a?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=i(o.pathname,a.pathname)):o.pathname=a.pathname:o.pathname||(o.pathname="/"),o}function m(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,a):n.push(a),d({action:r,location:a,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",a=p(e,t,g(),w.location);c.confirmTransitionTo(a,r,n,(function(e){e&&(w.entries[w.index]=a,d({action:r,location:a}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=w.index+e;return t>=0&&t{"use strict";var r=n(4363),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var a=p(n);a&&a!==m&&e(t,a,r)}var i=c(n);d&&(i=i.concat(d(n)));for(var l=s(t),g=s(n),h=0;h{"use strict";e.exports=function(e,t,n,r,a,o,i,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,a,o,i,l],c=0;(s=new Error(t.replace(/%s/g,(function(){return u[c++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},4634:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},119:(e,t,n)=>{"use strict";n.r(t)},1043:(e,t,n)=>{"use strict";n.r(t)},5947:function(e,t,n){var r,a;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};function a(e,t,n){return en?n:e}function o(e){return 100*(-1+e)}function i(e,t,n){var a;return(a="translate3d"===r.positionUsing?{transform:"translate3d("+o(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+o(e)+"%,0)"}:{"margin-left":o(e)+"%"}).transition="all "+t+"ms "+n,a}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=a(e,r.minimum,1),n.status=1===e?null:e;var o=n.render(!t),u=o.querySelector(r.barSelector),c=r.speed,d=r.easing;return o.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(u,i(e,c,d)),1===e?(s(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout((function(){s(o,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),c)}),c)):setTimeout(t,c)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*a(Math.random()*t,.1,.95)),t=a(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");c(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var a,i=t.querySelector(r.barSelector),l=e?"-100":o(n.status||0),u=document.querySelector(r.parent);return s(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(a=t.querySelector(r.spinnerSelector))&&p(a),u!=document.body&&c(u,"nprogress-custom-parent"),u.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,a=e.length,o=t.charAt(0).toUpperCase()+t.slice(1);a--;)if((r=e[a]+o)in n)return r;return t}function a(e){return e=n(e),t[e]||(t[e]=r(e))}function o(e,t,n){t=a(t),e.style[t]=n}return function(e,t){var n,r,a=arguments;if(2==a.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&o(e,n,r);else o(e,a[1],a[2])}}();function u(e,t){return("string"==typeof e?e:f(e)).indexOf(" "+t+" ")>=0}function c(e,t){var n=f(e),r=n+t;u(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=f(e);u(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function f(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(a="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=a)},5302:(e,t,n)=>{var r=n(4634);e.exports=p,e.exports.parse=o,e.exports.compile=function(e,t){return l(o(e,t),t)},e.exports.tokensToFunction=l,e.exports.tokensToRegExp=f;var a=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,i=0,l="",c=t&&t.delimiter||"/";null!=(n=a.exec(e));){var d=n[0],f=n[1],p=n.index;if(l+=e.slice(i,p),i=p+d.length,f)l+=f[1];else{var m=e[i],g=n[2],h=n[3],y=n[4],b=n[5],v=n[6],w=n[7];l&&(r.push(l),l="");var k=null!=g&&null!=m&&m!==g,x="+"===v||"*"===v,S="?"===v||"*"===v,E=n[2]||c,C=y||b;r.push({name:h||o++,prefix:g||"",delimiter:E,optional:S,repeat:x,partial:k,asterisk:!!w,pattern:C?u(C):w?".*":"[^"+s(E)+"]+?"})}}return i{Prism.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}},9700:()=>{!function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,a,o){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(a,(function(e){if("function"==typeof o&&!o(e))return e;for(var a,l=i.length;-1!==n.code.indexOf(a=t(r,l));)++l;return i[l]=e,a})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var a=0,o=Object.keys(n.tokenStack);!function i(l){for(var s=0;s=o.length);s++){var u=l[s];if("string"==typeof u||u.content&&"string"==typeof u.content){var c=o[a],d=n.tokenStack[c],f="string"==typeof u?u:u.content,p=t(r,c),m=f.indexOf(p);if(m>-1){++a;var g=f.substring(0,m),h=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),y=f.substring(m+p.length),b=[];g&&b.push.apply(b,i([g])),b.push(h),y&&b.push.apply(b,i([y])),"string"==typeof u?l.splice.apply(l,[s,1].concat(b)):u.content=b}}else u.content&&i(u.content)}return l}(n.tokens)}}}})}(Prism)},3890:(e,t,n)=>{var r={"./prism-lua":64};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=3890},2694:(e,t,n)=>{"use strict";var r=n(6925);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},5556:(e,t,n)=>{e.exports=n(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2551:(e,t,n)=>{"use strict";var r=n(6540),a=n(9982);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n