Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use bevy::core_pipeline::clear_color::ClearColorConfig;
- use bevy::prelude::*;
- use bevy::sprite::MaterialMesh2dBundle;
- #[test]
- fn main() {
- println!("Hello, world!");
- App::new()
- .add_plugins(DefaultPlugins)
- .add_systems(Startup, setup)
- .run();
- }
- fn setup(
- mut commands: Commands,
- mut meshes: ResMut<Assets<Mesh>>,
- mut materials: ResMut<Assets<ColorMaterial>>,
- ) {
- commands.spawn(Camera2dBundle {
- camera_2d: Camera2d {
- clear_color: ClearColorConfig::Custom(Color::BLACK),
- },
- ..default()
- });
- commands.spawn(MaterialMesh2dBundle {
- mesh: meshes.add(shape::Circle::new(50.0).into()).into(),
- material: materials.add(ColorMaterial::from(Color::PURPLE)),
- transform: Transform::from_translation(Vec3::new(0.0, 0.0, 0.0)),
- ..default()
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement