Document ClearColorConfig (#9288)

# Objective

Document the `ClearColorConfig` enum, and describe the behavior of its
variants.
This commit is contained in:
Joseph 2023-07-29 15:22:49 -07:00 committed by GitHub
parent b4bc9e4a11
commit a88b9fc6a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,12 +4,18 @@ use bevy_reflect::{Reflect, ReflectDeserialize, ReflectSerialize};
use bevy_render::{color::Color, extract_resource::ExtractResource};
use serde::{Deserialize, Serialize};
/// For a camera, specifies the color used to clear the viewport before rendering.
#[derive(Reflect, Serialize, Deserialize, Clone, Debug, Default)]
#[reflect(Serialize, Deserialize)]
pub enum ClearColorConfig {
/// The clear color is taken from the world's [`ClearColor`] resource.
#[default]
Default,
/// The given clear color is used, overriding the [`ClearColor`] resource defined in the world.
Custom(Color),
/// No clear color is used: the camera will simply draw on top of anything already in the viewport.
///
/// This can be useful when multiple cameras are rendering to the same viewport.
None,
}