mirror of
https://github.com/bevyengine/bevy
synced 2024-11-25 22:20:20 +00:00
Non-breaking change* from UK spellings to US (#8291)
Fixes issue mentioned in PR #8285. _Note: By mistake, this is currently dependent on #8285_ # Objective Ensure consistency in the spelling of the documentation. Exceptions: `crates/bevy_mikktspace/src/generated.rs` - Has not been changed from licence to license as it is part of a licensing agreement. Maybe for further consistency, https://github.com/bevyengine/bevy-website should also be given a look. ## Solution ### Changed the spelling of the current words (UK/CN/AU -> US) : cancelled -> canceled (Breaking API changes in #8285) behaviour -> behavior (Breaking API changes in #8285) neighbour -> neighbor grey -> gray recognise -> recognize centre -> center metres -> meters colour -> color ### ~~Update [`engine_style_guide.md`]~~ Moved to #8324 --- ## Changelog Changed UK spellings in documentation to US ## Migration Guide Non-breaking changes* \* If merged after #8285
This commit is contained in:
parent
3ead10a3e0
commit
e9312254d8
28 changed files with 52 additions and 52 deletions
|
@ -268,7 +268,7 @@ impl App {
|
||||||
///
|
///
|
||||||
/// Windowed apps are typically driven by an *event loop* or *message loop* and
|
/// Windowed apps are typically driven by an *event loop* or *message loop* and
|
||||||
/// some window-manager APIs expect programs to terminate when their primary
|
/// some window-manager APIs expect programs to terminate when their primary
|
||||||
/// window is closed and that event loop terminates – behaviour of processes that
|
/// window is closed and that event loop terminates – behavior of processes that
|
||||||
/// do not is often platform dependent or undocumented.
|
/// do not is often platform dependent or undocumented.
|
||||||
///
|
///
|
||||||
/// By default, *Bevy* uses the `winit` crate for window creation. See
|
/// By default, *Bevy* uses the `winit` crate for window creation. See
|
||||||
|
|
|
@ -129,7 +129,7 @@ fn tick_global_task_pools(_main_thread_marker: Option<NonSend<NonSendMarker>>) {
|
||||||
/// Maintains a count of frames rendered since the start of the application.
|
/// Maintains a count of frames rendered since the start of the application.
|
||||||
///
|
///
|
||||||
/// [`FrameCount`] is incremented during [`Last`], providing predictable
|
/// [`FrameCount`] is incremented during [`Last`], providing predictable
|
||||||
/// behaviour: it will be 0 during the first update, 1 during the next, and so forth.
|
/// behavior: it will be 0 during the first update, 1 during the next, and so forth.
|
||||||
///
|
///
|
||||||
/// # Overflows
|
/// # Overflows
|
||||||
///
|
///
|
||||||
|
|
|
@ -86,7 +86,7 @@ fn fragment(in: FullscreenVertexOutput) -> @location(0) vec4<f32> {
|
||||||
// Luma at the current fragment
|
// Luma at the current fragment
|
||||||
let lumaCenter = rgb2luma(colorCenter);
|
let lumaCenter = rgb2luma(colorCenter);
|
||||||
|
|
||||||
// Luma at the four direct neighbours of the current fragment.
|
// Luma at the four direct neighbors of the current fragment.
|
||||||
let lumaDown = rgb2luma(textureSampleLevel(screenTexture, samp, texCoord, 0.0, vec2<i32>(0, -1)).rgb);
|
let lumaDown = rgb2luma(textureSampleLevel(screenTexture, samp, texCoord, 0.0, vec2<i32>(0, -1)).rgb);
|
||||||
let lumaUp = rgb2luma(textureSampleLevel(screenTexture, samp, texCoord, 0.0, vec2<i32>(0, 1)).rgb);
|
let lumaUp = rgb2luma(textureSampleLevel(screenTexture, samp, texCoord, 0.0, vec2<i32>(0, 1)).rgb);
|
||||||
let lumaLeft = rgb2luma(textureSampleLevel(screenTexture, samp, texCoord, 0.0, vec2<i32>(-1, 0)).rgb);
|
let lumaLeft = rgb2luma(textureSampleLevel(screenTexture, samp, texCoord, 0.0, vec2<i32>(-1, 0)).rgb);
|
||||||
|
@ -237,7 +237,7 @@ fn fragment(in: FullscreenVertexOutput) -> @location(0) vec4<f32> {
|
||||||
// Is the luma at center smaller than the local average ?
|
// Is the luma at center smaller than the local average ?
|
||||||
let isLumaCenterSmaller = lumaCenter < lumaLocalAverage;
|
let isLumaCenterSmaller = lumaCenter < lumaLocalAverage;
|
||||||
|
|
||||||
// If the luma at center is smaller than at its neighbour, the delta luma at each end should be positive (same variation).
|
// If the luma at center is smaller than at its neighbor, the delta luma at each end should be positive (same variation).
|
||||||
let correctVariation1 = (lumaEnd1 < 0.0) != isLumaCenterSmaller;
|
let correctVariation1 = (lumaEnd1 < 0.0) != isLumaCenterSmaller;
|
||||||
let correctVariation2 = (lumaEnd2 < 0.0) != isLumaCenterSmaller;
|
let correctVariation2 = (lumaEnd2 < 0.0) != isLumaCenterSmaller;
|
||||||
|
|
||||||
|
|
|
@ -168,14 +168,14 @@ fn saturation(color: vec3<f32>, saturationAmount: f32) -> vec3<f32> {
|
||||||
ref[0]
|
ref[0]
|
||||||
*/
|
*/
|
||||||
fn convertOpenDomainToNormalizedLog2(color: vec3<f32>, minimum_ev: f32, maximum_ev: f32) -> vec3<f32> {
|
fn convertOpenDomainToNormalizedLog2(color: vec3<f32>, minimum_ev: f32, maximum_ev: f32) -> vec3<f32> {
|
||||||
let in_midgrey = 0.18;
|
let in_midgray = 0.18;
|
||||||
|
|
||||||
// remove negative before log transform
|
// remove negative before log transform
|
||||||
var color = max(vec3(0.0), color);
|
var color = max(vec3(0.0), color);
|
||||||
// avoid infinite issue with log -- ref[1]
|
// avoid infinite issue with log -- ref[1]
|
||||||
color = select(color, 0.00001525878 + color, color < 0.00003051757);
|
color = select(color, 0.00001525878 + color, color < 0.00003051757);
|
||||||
color = clamp(
|
color = clamp(
|
||||||
log2(color / in_midgrey),
|
log2(color / in_midgray),
|
||||||
vec3(minimum_ev),
|
vec3(minimum_ev),
|
||||||
vec3(maximum_ev)
|
vec3(maximum_ev)
|
||||||
);
|
);
|
||||||
|
@ -187,12 +187,12 @@ fn convertOpenDomainToNormalizedLog2(color: vec3<f32>, minimum_ev: f32, maximum_
|
||||||
// Inverse of above
|
// Inverse of above
|
||||||
fn convertNormalizedLog2ToOpenDomain(color: vec3<f32>, minimum_ev: f32, maximum_ev: f32) -> vec3<f32> {
|
fn convertNormalizedLog2ToOpenDomain(color: vec3<f32>, minimum_ev: f32, maximum_ev: f32) -> vec3<f32> {
|
||||||
var color = color;
|
var color = color;
|
||||||
let in_midgrey = 0.18;
|
let in_midgray = 0.18;
|
||||||
let total_exposure = maximum_ev - minimum_ev;
|
let total_exposure = maximum_ev - minimum_ev;
|
||||||
|
|
||||||
color = (color * total_exposure) + minimum_ev;
|
color = (color * total_exposure) + minimum_ev;
|
||||||
color = pow(vec3(2.0), color);
|
color = pow(vec3(2.0), color);
|
||||||
color = color * in_midgrey;
|
color = color * in_midgray;
|
||||||
|
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,14 +39,14 @@ use std::any::TypeId;
|
||||||
/// will be overwritten.
|
/// will be overwritten.
|
||||||
///
|
///
|
||||||
/// Importantly, bundles are only their constituent set of components.
|
/// Importantly, bundles are only their constituent set of components.
|
||||||
/// You **should not** use bundles as a unit of behaviour.
|
/// You **should not** use bundles as a unit of behavior.
|
||||||
/// The behaviour of your app can only be considered in terms of components, as systems,
|
/// The behavior of your app can only be considered in terms of components, as systems,
|
||||||
/// which drive the behaviour of a `bevy` application, operate on combinations of
|
/// which drive the behavior of a `bevy` application, operate on combinations of
|
||||||
/// components.
|
/// components.
|
||||||
///
|
///
|
||||||
/// This rule is also important because multiple bundles may contain the same component type,
|
/// This rule is also important because multiple bundles may contain the same component type,
|
||||||
/// calculated in different ways — adding both of these bundles to one entity
|
/// calculated in different ways — adding both of these bundles to one entity
|
||||||
/// would create incoherent behaviour.
|
/// would create incoherent behavior.
|
||||||
/// This would be unexpected if bundles were treated as an abstraction boundary, as
|
/// This would be unexpected if bundles were treated as an abstraction boundary, as
|
||||||
/// the abstraction would be unmaintainable for these cases.
|
/// the abstraction would be unmaintainable for these cases.
|
||||||
/// For example, both `Camera3dBundle` and `Camera2dBundle` contain the `CameraRenderGraph`
|
/// For example, both `Camera3dBundle` and `Camera2dBundle` contain the `CameraRenderGraph`
|
||||||
|
|
|
@ -260,7 +260,7 @@ impl ComponentInfo {
|
||||||
/// represented as Rust types for scripting or other advanced use-cases.
|
/// represented as Rust types for scripting or other advanced use-cases.
|
||||||
///
|
///
|
||||||
/// A `ComponentId` is tightly coupled to its parent `World`. Attempting to use a `ComponentId` from
|
/// A `ComponentId` is tightly coupled to its parent `World`. Attempting to use a `ComponentId` from
|
||||||
/// one `World` to access the metadata of a `Component` in a different `World` is undefined behaviour
|
/// one `World` to access the metadata of a `Component` in a different `World` is undefined behavior
|
||||||
/// and must not be attempted.
|
/// and must not be attempted.
|
||||||
#[derive(Debug, Copy, Clone, Hash, Ord, PartialOrd, Eq, PartialEq)]
|
#[derive(Debug, Copy, Clone, Hash, Ord, PartialOrd, Eq, PartialEq)]
|
||||||
pub struct ComponentId(usize);
|
pub struct ComponentId(usize);
|
||||||
|
|
|
@ -211,8 +211,8 @@ impl<'w, 's, E: Event> EventReader<'w, 's, E> {
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// The following example shows a useful pattern where some behaviour is triggered if new events are available.
|
/// The following example shows a useful pattern where some behavior is triggered if new events are available.
|
||||||
/// [`EventReader::clear()`] is used so the same events don't re-trigger the behaviour the next time the system runs.
|
/// [`EventReader::clear()`] is used so the same events don't re-trigger the behavior the next time the system runs.
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # use bevy_ecs::prelude::*;
|
/// # use bevy_ecs::prelude::*;
|
||||||
|
|
|
@ -41,7 +41,7 @@ use std::{cell::UnsafeCell, marker::PhantomData};
|
||||||
/// Similar to change detection filters but it is used as a query fetch parameter.
|
/// Similar to change detection filters but it is used as a query fetch parameter.
|
||||||
/// It exposes methods to check for changes to the wrapped component.
|
/// It exposes methods to check for changes to the wrapped component.
|
||||||
///
|
///
|
||||||
/// Implementing the trait manually can allow for a fundamentally new type of behaviour.
|
/// Implementing the trait manually can allow for a fundamentally new type of behavior.
|
||||||
///
|
///
|
||||||
/// # Trait derivation
|
/// # Trait derivation
|
||||||
///
|
///
|
||||||
|
|
|
@ -193,7 +193,7 @@ macro_rules! impl_exclusive_system_function {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn run(&mut self, world: &mut World, _in: (), param_value: ExclusiveSystemParamItem< ($($param,)*)>) -> Out {
|
fn run(&mut self, world: &mut World, _in: (), param_value: ExclusiveSystemParamItem< ($($param,)*)>) -> Out {
|
||||||
// Yes, this is strange, but `rustc` fails to compile this impl
|
// Yes, this is strange, but `rustc` fails to compile this impl
|
||||||
// without using this function. It fails to recognise that `func`
|
// without using this function. It fails to recognize that `func`
|
||||||
// is a function, potentially because of the multiple impls of `FnMut`
|
// is a function, potentially because of the multiple impls of `FnMut`
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn call_inner<Out, $($param,)*>(
|
fn call_inner<Out, $($param,)*>(
|
||||||
|
@ -221,7 +221,7 @@ macro_rules! impl_exclusive_system_function {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn run(&mut self, world: &mut World, input: Input, param_value: ExclusiveSystemParamItem< ($($param,)*)>) -> Out {
|
fn run(&mut self, world: &mut World, input: Input, param_value: ExclusiveSystemParamItem< ($($param,)*)>) -> Out {
|
||||||
// Yes, this is strange, but `rustc` fails to compile this impl
|
// Yes, this is strange, but `rustc` fails to compile this impl
|
||||||
// without using this function. It fails to recognise that `func`
|
// without using this function. It fails to recognize that `func`
|
||||||
// is a function, potentially because of the multiple impls of `FnMut`
|
// is a function, potentially because of the multiple impls of `FnMut`
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn call_inner<Input, Out, $($param,)*>(
|
fn call_inner<Input, Out, $($param,)*>(
|
||||||
|
|
|
@ -644,7 +644,7 @@ macro_rules! impl_system_function {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn run(&mut self, _input: (), param_value: SystemParamItem< ($($param,)*)>) -> Out {
|
fn run(&mut self, _input: (), param_value: SystemParamItem< ($($param,)*)>) -> Out {
|
||||||
// Yes, this is strange, but `rustc` fails to compile this impl
|
// Yes, this is strange, but `rustc` fails to compile this impl
|
||||||
// without using this function. It fails to recognise that `func`
|
// without using this function. It fails to recognize that `func`
|
||||||
// is a function, potentially because of the multiple impls of `FnMut`
|
// is a function, potentially because of the multiple impls of `FnMut`
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn call_inner<Out, $($param,)*>(
|
fn call_inner<Out, $($param,)*>(
|
||||||
|
|
|
@ -96,8 +96,8 @@ pub enum ForceTouch {
|
||||||
///
|
///
|
||||||
/// It is used to describe the phase of the touch input that is currently active.
|
/// It is used to describe the phase of the touch input that is currently active.
|
||||||
/// This includes a phase that indicates that a touch input has started or ended,
|
/// This includes a phase that indicates that a touch input has started or ended,
|
||||||
/// or that a finger has moved. There is also a cancelled phase that indicates that
|
/// or that a finger has moved. There is also a canceled phase that indicates that
|
||||||
/// the system cancelled the tracking of the finger.
|
/// the system canceled the tracking of the finger.
|
||||||
#[derive(Debug, Hash, PartialEq, Eq, Clone, Copy, Reflect, FromReflect)]
|
#[derive(Debug, Hash, PartialEq, Eq, Clone, Copy, Reflect, FromReflect)]
|
||||||
#[reflect(Debug, Hash, PartialEq)]
|
#[reflect(Debug, Hash, PartialEq)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
|
@ -112,7 +112,7 @@ pub enum TouchPhase {
|
||||||
Moved,
|
Moved,
|
||||||
/// A finger stopped touching the touchscreen.
|
/// A finger stopped touching the touchscreen.
|
||||||
Ended,
|
Ended,
|
||||||
/// The system cancelled the tracking of the finger.
|
/// The system canceled the tracking of the finger.
|
||||||
///
|
///
|
||||||
/// This occurs when the window loses focus, or on iOS if the user moves the
|
/// This occurs when the window loses focus, or on iOS if the user moves the
|
||||||
/// device against their face.
|
/// device against their face.
|
||||||
|
@ -230,7 +230,7 @@ pub struct Touches {
|
||||||
just_pressed: HashMap<u64, Touch>,
|
just_pressed: HashMap<u64, Touch>,
|
||||||
/// A collection of every [`Touch`] that just got released.
|
/// A collection of every [`Touch`] that just got released.
|
||||||
just_released: HashMap<u64, Touch>,
|
just_released: HashMap<u64, Touch>,
|
||||||
/// A collection of every [`Touch`] that just got cancelled.
|
/// A collection of every [`Touch`] that just got canceled.
|
||||||
just_canceled: HashMap<u64, Touch>,
|
just_canceled: HashMap<u64, Touch>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,17 +280,17 @@ impl Touches {
|
||||||
self.just_released.values()
|
self.just_released.values()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Checks if any touch input was just cancelled.
|
/// Checks if any touch input was just canceled.
|
||||||
pub fn any_just_canceled(&self) -> bool {
|
pub fn any_just_canceled(&self) -> bool {
|
||||||
!self.just_canceled.is_empty()
|
!self.just_canceled.is_empty()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns `true` if the input corresponding to the `id` has just been cancelled.
|
/// Returns `true` if the input corresponding to the `id` has just been canceled.
|
||||||
pub fn just_canceled(&self, id: u64) -> bool {
|
pub fn just_canceled(&self, id: u64) -> bool {
|
||||||
self.just_canceled.contains_key(&id)
|
self.just_canceled.contains_key(&id)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An iterator visiting every just cancelled [`Touch`] input in arbitrary order.
|
/// An iterator visiting every just canceled [`Touch`] input in arbitrary order.
|
||||||
pub fn iter_just_canceled(&self) -> impl Iterator<Item = &Touch> {
|
pub fn iter_just_canceled(&self) -> impl Iterator<Item = &Touch> {
|
||||||
self.just_canceled.values()
|
self.just_canceled.values()
|
||||||
}
|
}
|
||||||
|
@ -389,7 +389,7 @@ mod test {
|
||||||
force: None,
|
force: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Add a touch to `just_pressed`, 'just_released', and 'just cancelled'
|
// Add a touch to `just_pressed`, 'just_released', and 'just canceled'
|
||||||
|
|
||||||
touches.just_pressed.insert(4, touch_event);
|
touches.just_pressed.insert(4, touch_event);
|
||||||
touches.just_released.insert(4, touch_event);
|
touches.just_released.insert(4, touch_event);
|
||||||
|
|
|
@ -124,7 +124,7 @@ impl SpotLight {
|
||||||
|
|
||||||
impl Default for SpotLight {
|
impl Default for SpotLight {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
// a quarter arc attenuating from the centre
|
// a quarter arc attenuating from the center
|
||||||
Self {
|
Self {
|
||||||
color: Color::rgb(1.0, 1.0, 1.0),
|
color: Color::rgb(1.0, 1.0, 1.0),
|
||||||
/// Luminous power in lumens
|
/// Luminous power in lumens
|
||||||
|
|
|
@ -641,7 +641,7 @@ pub(crate) fn spot_light_view_matrix(transform: &GlobalTransform) -> Mat4 {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn spot_light_projection_matrix(angle: f32) -> Mat4 {
|
pub(crate) fn spot_light_projection_matrix(angle: f32) -> Mat4 {
|
||||||
// spot light projection FOV is 2x the angle from spot light centre to outer edge
|
// spot light projection FOV is 2x the angle from spot light center to outer edge
|
||||||
Mat4::perspective_infinite_reverse_rh(angle * 2.0, 1.0, POINT_LIGHT_NEAR_Z)
|
Mat4::perspective_infinite_reverse_rh(angle * 2.0, 1.0, POINT_LIGHT_NEAR_Z)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ fn fetch_point_shadow(light_id: u32, frag_position: vec4<f32>, surface_normal: v
|
||||||
// Do the lookup, using HW PCF and comparison. Cubemaps assume a left-handed coordinate space,
|
// Do the lookup, using HW PCF and comparison. Cubemaps assume a left-handed coordinate space,
|
||||||
// so we have to flip the z-axis when sampling.
|
// so we have to flip the z-axis when sampling.
|
||||||
// NOTE: Due to the non-uniform control flow above, we must use the Level variant of
|
// NOTE: Due to the non-uniform control flow above, we must use the Level variant of
|
||||||
// textureSampleCompare to avoid undefined behaviour due to some of the fragments in
|
// textureSampleCompare to avoid undefined behavior due to some of the fragments in
|
||||||
// a quad (2x2 fragments) being processed not being sampled, and this messing with
|
// a quad (2x2 fragments) being processed not being sampled, and this messing with
|
||||||
// mip-mapping functionality. The shadow maps have no mipmaps so Level just samples
|
// mip-mapping functionality. The shadow maps have no mipmaps so Level just samples
|
||||||
// from LOD 0.
|
// from LOD 0.
|
||||||
|
|
|
@ -31,7 +31,7 @@ pub(crate) enum ReflectIgnoreBehavior {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ReflectIgnoreBehavior {
|
impl ReflectIgnoreBehavior {
|
||||||
/// Returns `true` if the ignoring behaviour implies member is included in the reflection API, and false otherwise.
|
/// Returns `true` if the ignoring behavior implies member is included in the reflection API, and false otherwise.
|
||||||
pub fn is_active(self) -> bool {
|
pub fn is_active(self) -> bool {
|
||||||
match self {
|
match self {
|
||||||
ReflectIgnoreBehavior::None | ReflectIgnoreBehavior::IgnoreSerialization => true,
|
ReflectIgnoreBehavior::None | ReflectIgnoreBehavior::IgnoreSerialization => true,
|
||||||
|
|
|
@ -177,7 +177,7 @@ impl<T> ResultSifter<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Converts an iterator over ignore behaviour of members to a bitset of ignored members.
|
/// Converts an iterator over ignore behavior of members to a bitset of ignored members.
|
||||||
///
|
///
|
||||||
/// Takes into account the fact that always ignored (non-reflected) members are skipped.
|
/// Takes into account the fact that always ignored (non-reflected) members are skipped.
|
||||||
///
|
///
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
//! In Bevy each view (camera, or shadow-casting light, etc.) has one or multiple [`RenderPhase`]s
|
//! In Bevy each view (camera, or shadow-casting light, etc.) has one or multiple [`RenderPhase`]s
|
||||||
//! (e.g. opaque, transparent, shadow, etc).
|
//! (e.g. opaque, transparent, shadow, etc).
|
||||||
//! They are used to queue entities for rendering.
|
//! They are used to queue entities for rendering.
|
||||||
//! Multiple phases might be required due to different sorting/batching behaviours
|
//! Multiple phases might be required due to different sorting/batching behaviors
|
||||||
//! (e.g. opaque: front to back, transparent: back to front) or because one phase depends on
|
//! (e.g. opaque: front to back, transparent: back to front) or because one phase depends on
|
||||||
//! the rendered texture of the previous phase (e.g. for screen-space reflections).
|
//! the rendered texture of the previous phase (e.g. for screen-space reflections).
|
||||||
//!
|
//!
|
||||||
|
@ -45,7 +45,7 @@ use std::ops::Range;
|
||||||
///
|
///
|
||||||
/// Each view (camera, or shadow-casting light, etc.) can have one or multiple render phases.
|
/// Each view (camera, or shadow-casting light, etc.) can have one or multiple render phases.
|
||||||
/// They are used to queue entities for rendering.
|
/// They are used to queue entities for rendering.
|
||||||
/// Multiple phases might be required due to different sorting/batching behaviours
|
/// Multiple phases might be required due to different sorting/batching behaviors
|
||||||
/// (e.g. opaque: front to back, transparent: back to front) or because one phase depends on
|
/// (e.g. opaque: front to back, transparent: back to front) or because one phase depends on
|
||||||
/// the rendered texture of the previous phase (e.g. for screen-space reflections).
|
/// the rendered texture of the previous phase (e.g. for screen-space reflections).
|
||||||
/// All [`PhaseItem`]s are then rendered using a single [`TrackedRenderPass`].
|
/// All [`PhaseItem`]s are then rendered using a single [`TrackedRenderPass`].
|
||||||
|
|
|
@ -501,7 +501,7 @@ impl TaskPool {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Spawns a static future onto the thread pool. The returned Task is a future. It can also be
|
/// Spawns a static future onto the thread pool. The returned Task is a future. It can also be
|
||||||
/// cancelled and "detached" allowing it to continue running without having to be polled by the
|
/// canceled and "detached" allowing it to continue running without having to be polled by the
|
||||||
/// end-user.
|
/// end-user.
|
||||||
///
|
///
|
||||||
/// If the provided future is non-`Send`, [`TaskPool::spawn_local`] should be used instead.
|
/// If the provided future is non-`Send`, [`TaskPool::spawn_local`] should be used instead.
|
||||||
|
@ -514,7 +514,7 @@ impl TaskPool {
|
||||||
|
|
||||||
/// Spawns a static future on the thread-local async executor for the current thread. The task
|
/// Spawns a static future on the thread-local async executor for the current thread. The task
|
||||||
/// will run entirely on the thread the task was spawned on. The returned Task is a future.
|
/// will run entirely on the thread the task was spawned on. The returned Task is a future.
|
||||||
/// It can also be cancelled and "detached" allowing it to continue running without having
|
/// It can also be canceled and "detached" allowing it to continue running without having
|
||||||
/// to be polled by the end-user. Users should generally prefer to use [`TaskPool::spawn`]
|
/// to be polled by the end-user. Users should generally prefer to use [`TaskPool::spawn`]
|
||||||
/// instead, unless the provided future is not `Send`.
|
/// instead, unless the provided future is not `Send`.
|
||||||
pub fn spawn_local<T>(&self, future: impl Future<Output = T> + 'static) -> Task<T>
|
pub fn spawn_local<T>(&self, future: impl Future<Output = T> + 'static) -> Task<T>
|
||||||
|
|
|
@ -180,10 +180,10 @@ impl Default for TextStyle {
|
||||||
pub enum BreakLineOn {
|
pub enum BreakLineOn {
|
||||||
/// Uses the [Unicode Line Breaking Algorithm](https://www.unicode.org/reports/tr14/).
|
/// Uses the [Unicode Line Breaking Algorithm](https://www.unicode.org/reports/tr14/).
|
||||||
/// Lines will be broken up at the nearest suitable word boundary, usually a space.
|
/// Lines will be broken up at the nearest suitable word boundary, usually a space.
|
||||||
/// This behaviour suits most cases, as it keeps words intact across linebreaks.
|
/// This behavior suits most cases, as it keeps words intact across linebreaks.
|
||||||
WordBoundary,
|
WordBoundary,
|
||||||
/// Lines will be broken without discrimination on any character that would leave bounds.
|
/// Lines will be broken without discrimination on any character that would leave bounds.
|
||||||
/// This is closer to the behaviour one might expect from text in a terminal.
|
/// This is closer to the behavior one might expect from text in a terminal.
|
||||||
/// However it may lead to words being broken up across linebreaks.
|
/// However it may lead to words being broken up across linebreaks.
|
||||||
AnyCharacter,
|
AnyCharacter,
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ pub struct WindowCreated {
|
||||||
///
|
///
|
||||||
/// If the default [`WindowPlugin`] is used, these events are handled
|
/// If the default [`WindowPlugin`] is used, these events are handled
|
||||||
/// by closing the corresponding [`Window`].
|
/// by closing the corresponding [`Window`].
|
||||||
/// To disable this behaviour, set `close_when_requested` on the [`WindowPlugin`]
|
/// To disable this behavior, set `close_when_requested` on the [`WindowPlugin`]
|
||||||
/// to `false`.
|
/// to `false`.
|
||||||
///
|
///
|
||||||
/// [`WindowPlugin`]: crate::WindowPlugin
|
/// [`WindowPlugin`]: crate::WindowPlugin
|
||||||
|
@ -269,9 +269,9 @@ pub enum FileDragAndDrop {
|
||||||
path_buf: PathBuf,
|
path_buf: PathBuf,
|
||||||
},
|
},
|
||||||
|
|
||||||
/// File hovering was cancelled.
|
/// File hovering was canceled.
|
||||||
HoveredFileCanceled {
|
HoveredFileCanceled {
|
||||||
/// Window that had a cancelled file drop.
|
/// Window that had a canceled file drop.
|
||||||
window: Entity,
|
window: Entity,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ use bevy_input::{keyboard::KeyCode, Input};
|
||||||
/// Exit the application when there are no open windows.
|
/// Exit the application when there are no open windows.
|
||||||
///
|
///
|
||||||
/// This system is added by the [`WindowPlugin`] in the default configuration.
|
/// This system is added by the [`WindowPlugin`] in the default configuration.
|
||||||
/// To disable this behaviour, set `close_when_requested` (on the [`WindowPlugin`]) to `false`.
|
/// To disable this behavior, set `close_when_requested` (on the [`WindowPlugin`]) to `false`.
|
||||||
/// Ensure that you read the caveats documented on that field if doing so.
|
/// Ensure that you read the caveats documented on that field if doing so.
|
||||||
///
|
///
|
||||||
/// [`WindowPlugin`]: crate::WindowPlugin
|
/// [`WindowPlugin`]: crate::WindowPlugin
|
||||||
|
@ -36,7 +36,7 @@ pub fn exit_on_primary_closed(
|
||||||
/// Close windows in response to [`WindowCloseRequested`] (e.g. when the close button is pressed).
|
/// Close windows in response to [`WindowCloseRequested`] (e.g. when the close button is pressed).
|
||||||
///
|
///
|
||||||
/// This system is added by the [`WindowPlugin`] in the default configuration.
|
/// This system is added by the [`WindowPlugin`] in the default configuration.
|
||||||
/// To disable this behaviour, set `close_when_requested` (on the [`WindowPlugin`]) to `false`.
|
/// To disable this behavior, set `close_when_requested` (on the [`WindowPlugin`]) to `false`.
|
||||||
/// Ensure that you read the caveats documented on that field if doing so.
|
/// Ensure that you read the caveats documented on that field if doing so.
|
||||||
///
|
///
|
||||||
/// [`WindowPlugin`]: crate::WindowPlugin
|
/// [`WindowPlugin`]: crate::WindowPlugin
|
||||||
|
|
|
@ -69,7 +69,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
Player {
|
Player {
|
||||||
movement_speed: 500.0, // metres per second
|
movement_speed: 500.0, // meters per second
|
||||||
rotation_speed: f32::to_radians(360.0), // degrees per second
|
rotation_speed: f32::to_radians(360.0), // degrees per second
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
|
|
|
@ -81,7 +81,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||||
|
|
||||||
// ambient light
|
// ambient light
|
||||||
// NOTE: The ambient light is used to scale how bright the environment map is so with a bright
|
// NOTE: The ambient light is used to scale how bright the environment map is so with a bright
|
||||||
// environment map, use an appropriate colour and brightness to match
|
// environment map, use an appropriate color and brightness to match
|
||||||
commands.insert_resource(AmbientLight {
|
commands.insert_resource(AmbientLight {
|
||||||
color: Color::rgb_u8(210, 220, 240),
|
color: Color::rgb_u8(210, 220, 240),
|
||||||
brightness: 1.0,
|
brightness: 1.0,
|
||||||
|
|
|
@ -221,7 +221,7 @@ fn select(
|
||||||
text.sections[1].style.color = sprite.color;
|
text.sections[1].style.color = sprite.color;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Change the modulate color to the "deselected" colour and push
|
/// Change the modulate color to the "deselected" color and push
|
||||||
/// the object to the back.
|
/// the object to the back.
|
||||||
fn deselect(sprite: &mut Sprite, contributor: &Contributor, transform: &mut Transform) {
|
fn deselect(sprite: &mut Sprite, contributor: &Contributor, transform: &mut Transform) {
|
||||||
sprite.color = Color::hsla(
|
sprite.color = Color::hsla(
|
||||||
|
|
|
@ -301,7 +301,7 @@ mod menu {
|
||||||
OnExit(MenuState::SettingsSound),
|
OnExit(MenuState::SettingsSound),
|
||||||
despawn_screen::<OnSoundSettingsMenuScreen>,
|
despawn_screen::<OnSoundSettingsMenuScreen>,
|
||||||
)
|
)
|
||||||
// Common systems to all screens that handles buttons behaviour
|
// Common systems to all screens that handles buttons behavior
|
||||||
.add_systems(
|
.add_systems(
|
||||||
Update,
|
Update,
|
||||||
(menu_action, button_system).run_if(in_state(GameState::Menu)),
|
(menu_action, button_system).run_if(in_state(GameState::Menu)),
|
||||||
|
|
|
@ -27,7 +27,7 @@ fn touch_system(touches: Res<Touches>) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for touch in touches.iter_just_canceled() {
|
for touch in touches.iter_just_canceled() {
|
||||||
info!("cancelled touch with id: {:?}", touch.id());
|
info!("canceled touch with id: {:?}", touch.id());
|
||||||
}
|
}
|
||||||
|
|
||||||
// you can also iterate all current touches and retrieve their state like this:
|
// you can also iterate all current touches and retrieve their state like this:
|
||||||
|
|
|
@ -44,7 +44,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
commands.spawn(TextBundle::from_section(
|
commands.spawn(TextBundle::from_section(
|
||||||
"This text is very long, has a limited width, is centred, is positioned in the top right and is also coloured pink.",
|
"This text is very long, has a limited width, is centered, is positioned in the top right and is also colored pink.",
|
||||||
TextStyle {
|
TextStyle {
|
||||||
font: font.clone(),
|
font: font.clone(),
|
||||||
font_size: 50.0,
|
font_size: 50.0,
|
||||||
|
|
|
@ -54,7 +54,7 @@ fn setup(mut commands: Commands) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// spawn a node with a positive local z-index of 2.
|
// spawn a node with a positive local z-index of 2.
|
||||||
// it will show above other nodes in the grey container.
|
// it will show above other nodes in the gray container.
|
||||||
parent.spawn(NodeBundle {
|
parent.spawn(NodeBundle {
|
||||||
z_index: ZIndex::Local(2),
|
z_index: ZIndex::Local(2),
|
||||||
background_color: Color::BLUE.into(),
|
background_color: Color::BLUE.into(),
|
||||||
|
@ -69,7 +69,7 @@ fn setup(mut commands: Commands) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// spawn a node with a negative local z-index.
|
// spawn a node with a negative local z-index.
|
||||||
// it will show under other nodes in the grey container.
|
// it will show under other nodes in the gray container.
|
||||||
parent.spawn(NodeBundle {
|
parent.spawn(NodeBundle {
|
||||||
z_index: ZIndex::Local(-1),
|
z_index: ZIndex::Local(-1),
|
||||||
background_color: Color::GREEN.into(),
|
background_color: Color::GREEN.into(),
|
||||||
|
@ -85,7 +85,7 @@ fn setup(mut commands: Commands) {
|
||||||
|
|
||||||
// spawn a node with a positive global z-index of 1.
|
// spawn a node with a positive global z-index of 1.
|
||||||
// it will show above all other nodes, because it's the highest global z-index in this example.
|
// it will show above all other nodes, because it's the highest global z-index in this example.
|
||||||
// by default, boxes all share the global z-index of 0 that the grey container is added to.
|
// by default, boxes all share the global z-index of 0 that the gray container is added to.
|
||||||
parent.spawn(NodeBundle {
|
parent.spawn(NodeBundle {
|
||||||
z_index: ZIndex::Global(1),
|
z_index: ZIndex::Global(1),
|
||||||
background_color: Color::PURPLE.into(),
|
background_color: Color::PURPLE.into(),
|
||||||
|
|
Loading…
Reference in a new issue