Skip to main content

pite_core/nodes/
mod.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2//! One file per node type. Each module owns its `SCHEMA` and `PROPS`.
3//!
4//! Abstract classes (`Control`, `CollisionObject2D`, `PhysicsBody2D`) exist
5//! so subclasses inherit shared props without redeclaring them; the engine
6//! still registers them (for compatibility with existing scenes), but the
7//! editor's add-node menu filters them out.
8
9pub mod animated_sprite2d;
10pub mod area2d;
11pub mod button;
12pub mod camera2d;
13pub mod character_body2d;
14pub mod collision_object2d;
15pub mod collision_shape2d;
16pub mod control;
17pub mod label;
18pub mod node;
19pub mod node2d;
20pub mod physics_body2d;
21pub mod rigid_body2d;
22pub mod sprite2d;
23pub mod static_body2d;
24pub mod tilemap;
25pub mod timer;
26
27use crate::schema::NodeTypeSchema;
28
29/// Every node schema, concrete and abstract, in a stable order.
30/// `pite-core::schema::NODE_SCHEMAS` re-exports this.
31pub static ALL_NODES: &[&NodeTypeSchema] = &[
32    // Concrete root
33    &node::SCHEMA,
34    // 2D hierarchy
35    &node2d::SCHEMA,
36    &control::SCHEMA,
37    &collision_object2d::SCHEMA,
38    &physics_body2d::SCHEMA,
39    // Concrete 2D
40    &sprite2d::SCHEMA,
41    &animated_sprite2d::SCHEMA,
42    &camera2d::SCHEMA,
43    &collision_shape2d::SCHEMA,
44    &area2d::SCHEMA,
45    &static_body2d::SCHEMA,
46    &rigid_body2d::SCHEMA,
47    &character_body2d::SCHEMA,
48    &tilemap::SCHEMA,
49    // UI
50    &label::SCHEMA,
51    &button::SCHEMA,
52    // Misc
53    &timer::SCHEMA,
54];