Skip to main content

game_toolkit/
lib.rs

1//! game-toolkit: a game-jam toolkit for 2D and 3D.
2//!
3//! This is the umbrella entry-point crate. Depend on `game-toolkit` and write
4//! `use game_toolkit::prelude::*;` to pull in the runtime types from the `game-toolkit-*`
5//! crates behind one dependency. Optional features: `ui`, `aseprite`, `ecs`, `synth`,
6//! `vector`.
7//!
8//! New here? The [`guide`] walks through the whole API on one page.
9
10#![forbid(unsafe_code)]
11
12#[cfg(feature = "aseprite")]
13mod aseprite_ext;
14
15pub mod guide;
16
17/// Everything you need to write a game: `use game_toolkit::prelude::*;`.
18pub mod prelude {
19    pub use anyhow;
20    pub use anyhow::Result;
21    pub use winit;
22
23    pub use game_toolkit_assets::Assets;
24    pub use game_toolkit_audio::{Audio, AudioError, PlayOptions, SoundHandle, SoundId, kira};
25    pub use game_toolkit_core::{AppConfig, Context, Game, GameEvent, Rng, Time, asset_root, run};
26    pub use game_toolkit_gfx::{
27        Align, BlendMode, Camera, Camera2D, Camera3D, CircleInstance, Color, Frame, Graphics,
28        Layer, Mat4, MeshId, MeshInstance, MeshVertex, Painter, SpriteInstance, TextureId,
29        TextureWrap, Tilemap, transform, wgpu,
30    };
31    pub use game_toolkit_input::{Axis, Button, Gamepad, GamepadId, Input, Key, MouseButton};
32
33    #[cfg(feature = "ui")]
34    pub use game_toolkit_ui::{self, Ui, egui};
35
36    #[cfg(feature = "aseprite")]
37    pub use crate::aseprite_ext::LoadAseprite;
38    #[cfg(feature = "aseprite")]
39    pub use game_toolkit_aseprite::{
40        self, Animation, AnimationPlayer, Direction, FrameRect, SpriteSheet,
41    };
42
43    #[cfg(feature = "synth")]
44    pub use game_toolkit_audio::{Synth, synthie};
45
46    #[cfg(feature = "ecs")]
47    pub use game_toolkit_ecs::{self, ChannelQueue, Vec2};
48
49    #[cfg(feature = "vector")]
50    pub use game_toolkit_gfx::vello;
51}