0% found this document useful (0 votes)
2 views1 page

Svelte - WorkAdventure Documentation

The document provides an overview of the WorkAdventure Scripting API, specifically focusing on integrating Svelte with WorkAdventure variables. It details how to create and bind Svelte stores to WorkAdventure variables using functions like createStoreFromVariable and mapVariableToStore. Additionally, it emphasizes the need to import the 'Scripting API Extra' library to utilize these functions.

Uploaded by

raziq.brown
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Svelte - WorkAdventure Documentation

The document provides an overview of the WorkAdventure Scripting API, specifically focusing on integrating Svelte with WorkAdventure variables. It details how to create and bind Svelte stores to WorkAdventure variables using functions like createStoreFromVariable and mapVariableToStore. Additionally, it emphasizes the need to import the 'Scripting API Extra' library to utilize these functions.

Uploaded by

raziq.brown
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Map Building Admin User Developer Tutorials Login Get Started Search ctrl K

Api Reference

Camera Map Scripting API Extended utility functions Svelte


Mapping a WorkAdventure variable to a Svelte
store
Chat

Controls Svelte
Event

Map Editor API IMPORTANT

Metadata To use these functions, you need to import the "Scripting API Extra" library.

Navigation
If you happen to use the Svelte framework, the Scripting API Extra package provide some utility functions to easily bind your Svelte
Player components to your WorkAdventure map.
Players

Room
Mapping a WorkAdventure variable to a Svelte store
Sound
Use createStoreFromVariable to create a Svelte store that is bound to a WorkAdventure variable.
Start

State
const myVariableStore = createStoreFromVariable('my_variable');
UI

Deprecated Functions createStoreFromVariable returns a writable store.

Extended utility functions


If you already have a Svelte store and you want to bind it to a WorkAdventure variable, use mapVariableToStore .
Tiled Layers

Tiled Properties // Maps a WorkAdventure variable to an existing store.


// The "myVariableStore" must be a Svelte store with a "set" function.
Svelte
mapVariableToStore('my_variable', myVariableStore);
Variables

Scripting Internals
Edit this page
Using Typescript

Map Storage API

Room API Previous Next


« Tiled Properties Variables »
Webhooks

Docs Need help ? Follow us

Map Building Book a demo Linkedin


Admin Discord Twitter
Developer GitHub Facebook

Copyright © 2024 workadventu.re - All Rights Reserved

You might also like