Skip to content

General purpose 2D lighting for the Bevy game engine.

License

Notifications You must be signed in to change notification settings

PatrickChodowski/bevy_light_2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bevy_light_2d

A general purpose 2d lighting plugin for bevy. Designed to be simple to use, yet expressive enough to fit a variety of needs.

Features

  • Component driven design
  • Configurable point lights
  • Camera specific ambient light

Usage

In the basic example, all we need is the plugin, a camera, and a light source.

# Cargo.toml
[dependencies]
bevy = "0.13"
bevy_light_2d = "0.1"
use bevy::prelude::*;
use bevy_light_2d::prelude::*;

fn main() {
    App::new()
        .add_plugins((DefaultPlugins, Light2dPlugin))
        .add_systems(Startup, setup)
        .run()
}

fn setup(mut commands: Commands) {
    commands.spawn(Camera2dBundle::default());
    
    commands.spawn(PointLight2dBundle {
        point_light: PointLight2d {
            color: Color::YELLOW,
            radius: 50.,
            ..default()
        },
        ..default()
    });
}

Bevy compatibility

bevy bevy_light_2d
0.13 0.1

About

General purpose 2D lighting for the Bevy game engine.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 81.8%
  • WGSL 18.2%