Skip to main content

game_toolkit/
lib.rs

1//! game-toolkit: a 2D-first game-jam toolkit.
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#![forbid(unsafe_code)]
9
10/// Everything you need to write a game: `use game_toolkit::prelude::*;`.
11pub mod prelude {
12    pub use anyhow;
13    pub use anyhow::Result;
14    pub use winit;
15
16    pub use game_toolkit_assets::Assets;
17    pub use game_toolkit_audio::{Audio, SoundId};
18    pub use game_toolkit_core::{AppConfig, Context, Game, GameEvent, Time, run};
19    pub use game_toolkit_gfx::{
20        BlendMode, Camera, Camera2D, Camera3D, CircleInstance, Frame, Graphics, Mat4, MeshId,
21        MeshInstance, MeshVertex, Painter, SpriteInstance, TextureId, Tilemap, transform, wgpu,
22    };
23    pub use game_toolkit_input::{Axis, Button, Gamepad, GamepadId, Input, Key, MouseButton};
24
25    #[cfg(feature = "ui")]
26    pub use game_toolkit_ui::{self, Ui, egui};
27
28    #[cfg(feature = "aseprite")]
29    pub use game_toolkit_aseprite::{
30        self, Animation, AnimationPlayer, Direction, FrameRect, SpriteSheet,
31    };
32
33    #[cfg(feature = "synth")]
34    pub use game_toolkit_audio::{Synth, synthie};
35
36    #[cfg(feature = "ecs")]
37    pub use game_toolkit_ecs::{self, ChannelQueue, Vec2};
38
39    #[cfg(feature = "vector")]
40    pub use game_toolkit_gfx::vello;
41}