[package] name = "pixel-game-lib" version = "0.8.1" edition = "2021" authors = ["Thomas Versteeg "] license = "AGPL-3.0" homepage = "https://github.com/tversteeg/pixel-game-lib" readme = "README.md" description = "Utility library for 2D pixel-based games" documentation = "https://docs.rs/pixel-game-lib" repository = "https://github.com/tversteeg/pixel-game-lib.git" keywords = ["gamedev", "utility"] categories = [ "games", "game-engines", ] rust-version = "1.72.1" [features] default = ["hot-reloading-assets", "physics"] # Embed a default pixel font. default-font = [] # Embed default graphics for GUI elements. default-gui = [] # Enable assets and hot-reload assets from disk when they are saved. # # Has no effect when building for the web. hot-reloading-assets = ["assets_manager/hot-reloading"] # Enable assets and include them all in the binary. # # Always enabled when building for the web. # # This feature takes precedence over `hot-reloading-assets` when both are set. embedded-assets = ["assets_manager/embedded"] # Enable the 2D physics engine. physics = ["dep:hecs", "dep:bvh-arena", "dep:parry2d-f64"] # Integrate [Yarn Spinner](https://www.yarnspinner.dev/), a friendly DSL for writing dialogue. dialogue = ["dep:yarnspinner"] # Allow playing music and sounds using the [Kira](https://docs.rs/kira/latest/kira/) crate. audio = ["dep:kira"] [dependencies] blit = { version = "0.8.4", features = ["serde"] } image = "0.24.9" miette = "7.1.0" vek = "0.16.1" game-loop = "1.1.0" pixels = "0.13.0" serde = { version = "1.0.197", features = ["derive"] } winit = { version = "0.29.14", features = ["rwh_05"] } winit_input_helper = "0.16.0" taffy = "0.4.0" derive-where = "1.2.7" puffin = "0.19.0" clipline = "0.2.0" bytemuck = "1.14.3" # `physics` feature bvh-arena = { version = "1.1.3", optional = true } hecs = { version = "0.10.4", optional = true, features = ["macros"] } parry2d-f64 = { version = "0.13.6", features = ["simd-stable"], optional = true } # `dialogue` feature yarnspinner = { version = "0.2.0", optional = true } # `audio` feature kira = { version = "0.8.7", default-features = false, features = ["cpal", "ogg", "serde"], optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] assets_manager = { version = "0.11.3", default-features = false, features = ["toml", "png", "ahash", "macros"] } tokio = { version = "1.36.0", features = ["macros", "sync", "rt-multi-thread"], optional = true } [target.'cfg(target_arch = "wasm32")'.dependencies] web-sys = { version = "0.3.69", features = ["CanvasRenderingContext2d", "Document", "Element", "HtmlCanvasElement", "ImageData", "Window"] } wasm-bindgen = "0.2.92" wasm-bindgen-futures = "0.4.42" console_error_panic_hook = "0.1.7" assets_manager = { version = "0.11.3", default-features = false, features = ["toml", "png", "embedded", "macros"] } [[example]] name = "window" [[example]] name = "font" [[example]] name = "gui" required-features = ["default-font", "default-gui"] [[example]] name = "physics" required-features = ["default-font", "physics"] [[example]] name = "dialogue" required-features = ["default-font", "default-gui", "dialogue"] [[example]] name = "audio" required-features = ["default-font", "audio"] [workspace] members = ["run-wasm"] # Ensure audio performance is not too poor when running in dev mode [profile.dev.package] kira.opt-level = 3 cpal.opt-level = 3 symphonia.opt-level = 3 symphonia-format-ogg.opt-level = 3 symphonia-codec-vorbis.opt-level = 3