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::{
25        Audio, AudioError, AudioStream, PlayOptions, SoundHandle, SoundId, StreamHandle, kira,
26    };
27    pub use game_toolkit_core::{AppConfig, Context, Game, GameEvent, Rng, Time, asset_root, run};
28    pub use game_toolkit_gfx::{
29        Align, BlendMode, Camera, Camera2D, Camera3D, CircleInstance, Color, Frame, Graphics,
30        Layer, Mat4, MeshId, MeshInstance, MeshVertex, Painter, SpriteInstance, TextureId,
31        TextureWrap, Tilemap, transform, wgpu,
32    };
33    pub use game_toolkit_input::{
34        Axis, Button, Gamepad, GamepadId, Input, Key, MouseButton, Touch,
35    };
36
37    #[cfg(feature = "ui")]
38    pub use game_toolkit_ui::{self, Ui, egui};
39
40    #[cfg(feature = "aseprite")]
41    pub use crate::aseprite_ext::LoadAseprite;
42    #[cfg(feature = "aseprite")]
43    pub use game_toolkit_aseprite::{
44        self, Animation, AnimationPlayer, Direction, FrameRect, SpriteSheet,
45    };
46
47    #[cfg(feature = "synth")]
48    pub use game_toolkit_audio::{Synth, synthie};
49
50    #[cfg(feature = "ecs")]
51    pub use game_toolkit_ecs::{self, ChannelQueue, Vec2};
52
53    #[cfg(feature = "vector")]
54    pub use game_toolkit_gfx::vello;
55}