mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-09 00:09:55 +00:00
add1e79fea0f1d45ce6253b29cf18d1da7e8fe4a
Allow to send change events from typescript to bevy
Example (test)
```rust
CHANGE_FROM_UI.write_message(UpdateField {
component: "bevy_transform::components::transform::Transform".to_string(),
reflect_path: ".translation.x".to_string(),
value: 0.to_string(),
});
```
Function for typescript
```rust
#[wasm_bindgen(js_name = changeValue)]
pub fn change_value(msg: String) {
let Ok(msg) = serde_json::from_str::<UpdateField>(&msg) else {
error!("Failed to parse message: {}", msg);
return;
};
CHANGE_FROM_UI.write_message(msg);
}
```
Storyteller Studio
Installing dependencies
- Install Rust
- Install Node.js LTS
- Run
npm ci
Building / Running / Testing stuff
This repo is managed by Nx, a polyglot build system and monorepo framework written in TypeScript. After installing dependencies, dev tasks can be run through the Nx CLI:
npx nx <command> <project> [options]
# OR
npx nx run <project>:<command> [options]
For example, to compile the Bevy app to WebAssembly and serve it via the web frontend project, run:
npx nx serve studio-frontend
Projects are located in directories at the workspace root. The list of commands
supported by a given project can be found under the target property of its
project.json file, which defines the Nx configuration for that project.
The full list of options for a given command can be discovered by passing the
--help flag:
npx nx <command> <project> --help
Description
Languages
Rust
59.2%
TypeScript
34.9%
SCSS
4.1%
JavaScript
1%
HTML
0.3%
Other
0.5%