Giter VIP home page Giter VIP logo

bevy_mod_krita's Introduction

bevy_mod_krita Crates.io version Crates.io license

Load Krita's .kra documents directly in Bevy for rapid prototyping or game jams.

Please keep in mind that .kra files are not optimized for size, so you should probably not use them for production bundles.

Bevy Compatibility

bevy version bevy_mod_krita version
0.12 0.3.0
0.11 0.2.0
0.10 0.1.0

Installation

cargo add bevy_mod_krita

Usage

Simply add the KritaPlugin to your app, enable hot reloading (optional) and load .kra files!

use bevy::prelude::*;
use bevy_mod_krita::KritaPlugin;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        // Add the Krita plugin to enable loading of `.kra` files
        .add_plugins(KritaPlugin)
        .add_systems(Startup, setup)
        .run();
}

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
    commands.spawn(Camera2dBundle::default());
    commands.spawn(SpriteBundle {
        // Load a Krita document as a texture
        texture: asset_server.load("krita/demo.kra"),
        ..default()
    });
}

License

This project is licensed under the terms of the MIT or Apache 2.0 license at your choice.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

bevy_mod_krita's People

Contributors

timjentzsch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bevy_mod_krita's Issues

Add example for using a Krita image as texture

There should be an example showcasing how the Krita file can be used to texture 3D objects as well.

This would also make for a cool showcase of the plugin if we have a video where a texture on a rotating cube is edited in Krita via hot reloading.

Improve README

The README is very bare-bones right now and doesn't contain any real information.

We should specify with which Bevy version this crate works, basic instructions on how to use it as well as the licenses we use.

Improve error handling in AssetLoader

The KritaDocumentLoader currently just passes any error up without any processing.

We should probably wrap the errors and provide additional information on where the error occurred.

Document usage with asset preprocessing

Bevy 0.12 introduced asset pre-processing.
This plays together very nicely with bevy_mod_krita:
Previously, if you used this plugin, you had to bundle the large .kra files with your Bevy app. This made it only useful for prototyping or perhaps game jams.
With pre-processing, you should be able to process the .kra file to a leaner image file instead, reducing the bundle size.
This could make bevy_mod_krita useful for a lot more applications.

Add CI

Add GitHub actions workflows to make sure that no errors sneak into the code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.