Skip to content

Commit 9c4ed1e

Browse files
committed
more info + fixes
1 parent 6434975 commit 9c4ed1e

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

src/_posts/2026-02-09-fyrox-game-engine-1.0.0-rc.2.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,26 @@ applying `?` operator.
4343
#[type_uuid(id = "bf0f9804-56cb-4a2e-beba-93d75371a568")]
4444
#[visit(optional)]
4545
struct MyScript {
46-
handle: Handle<Node>,
46+
rigid_body: Handle<RigidBody>,
47+
light: Handle<PointLight>,
4748
}
4849

4950
impl ScriptTrait for MyScript {
5051
fn on_update(&mut self, context: &mut ScriptContext) -> GameResult {
51-
let node = context.scene.graph.try_get(context.handle)?;
52+
let graph = &context.scene.graph;
53+
let node = graph.try_get(context.handle)?;
5254
println!("{}", node.name());
55+
let rigid_body = graph.try_get(self.rigid_body)?;
56+
let light = graph.try_get(self.light)?;
57+
// Do something useful.
5358
Ok(())
5459
}
5560
}
5661
```
5762

5863
When an error occurs in any of the methods, the engine simply prints it to the log and continues execution as usual.
59-
This is the key difference between errors and standard panic mechanism.
64+
This is the key difference between errors and standard panic mechanism. Error handling via `?` operator flattens the
65+
code and makes the code less verbose and much easier to read.
6066

6167
The `GameError` type can hold errors of pretty much any kind, so any error that implements `std::error::Error` trait
6268
can be returned.
@@ -91,7 +97,7 @@ error originates from.
9197
The engine now also allows you to handle all errors that may occur during script or plugin code execution. Each plugin
9298
has the `Plugin::on_game_error` method for that:
9399

94-
```rust,no_run
100+
```rust
95101
#[derive(Visit, Clone, Reflect, Debug)]
96102
struct MyGame;
97103

@@ -310,7 +316,8 @@ is separate threads.
310316
![bb code](/assets/1.0.0-rc.2/bb_code.png)
311317

312318
Fyrox now supports markup BBCode markup language for `Text` and `TextBox` widgets. This is a very simple approch that
313-
allows you to stylize the text with little to no effort.
319+
allows you to stylize the text with little to no effort. The main use case for this markup is to create stylized text
320+
that can be used for descriptions, where specific parts of the text need to be highlighted.
314321

315322
The available tags are:
316323

@@ -361,7 +368,8 @@ be written in an editor with syntax highlighting and more options.
361368
# What's Next?
362369

363370
The next major goal for the project is to release Fyrox 1.0, which is planned for the 7th birthday of
364-
the engine which is 19th of March 2026.
371+
the engine which is 19th of March 2026. The time before the first stable release will be spent on the final
372+
stabilization, book and docs improvements.
365373

366374
# Support
367375

0 commit comments

Comments
 (0)