pub struct RetroCameraBundle {
pub camera_render_graph: CameraRenderGraph,
pub orthographic_projection: OrthographicProjection,
pub visible_entities: VisibleEntities,
pub frustum: Frustum,
pub transform: Transform,
pub global_transform: GlobalTransform,
pub camera: Camera,
pub camera_2d: Camera2d,
}
Expand description
2D pixel-art camera with easy settings
Fields§
§camera_render_graph: CameraRenderGraph
§orthographic_projection: OrthographicProjection
§visible_entities: VisibleEntities
§frustum: Frustum
§transform: Transform
§global_transform: GlobalTransform
§camera: Camera
§camera_2d: Camera2d
Implementations§
Source§impl RetroCameraBundle
impl RetroCameraBundle
Sourcepub fn fixed_width(width: f32, scale: f32) -> Self
pub fn fixed_width(width: f32, scale: f32) -> Self
Create a camera with a fixed width in pixels and a height determined by the window aspect.
Sourcepub fn fixed_height(height: f32, scale: f32) -> Self
pub fn fixed_height(height: f32, scale: f32) -> Self
Create a camera with a fixed height in pixels and a width determined by the window aspect.
Sourcepub fn fixed_auto(size: f32, min_width: f32, min_height: f32) -> Self
pub fn fixed_auto(size: f32, min_width: f32, min_height: f32) -> Self
Switch automatically between fixed width and fixed height depending on window’s aspect ratio.
Trait Implementations§
Source§impl Bundle for RetroCameraBundle
SAFETY: ComponentId is returned in field-definition-order. [from_components] and [get_components] use field-definition-order
impl Bundle for RetroCameraBundle
SAFETY: ComponentId is returned in field-definition-order. [from_components] and [get_components] use field-definition-order
Source§fn component_ids(
components: &mut Components,
storages: &mut Storages,
) -> Vec<ComponentId>
fn component_ids( components: &mut Components, storages: &mut Storages, ) -> Vec<ComponentId>
Source§unsafe fn from_components<__T, __F>(ctx: &mut __T, func: __F) -> Self
unsafe fn from_components<__T, __F>(ctx: &mut __T, func: __F) -> Self
Source§fn get_components(self, func: impl FnMut(OwningPtr<'_>))
fn get_components(self, func: impl FnMut(OwningPtr<'_>))
Calls
func
on each value, in the order of this bundle’s Component
s. This will
std::mem::forget
the bundle fields, so callers are responsible for dropping the fields
if that is desirable.Auto Trait Implementations§
impl Freeze for RetroCameraBundle
impl RefUnwindSafe for RetroCameraBundle
impl Send for RetroCameraBundle
impl Sync for RetroCameraBundle
impl Unpin for RetroCameraBundle
impl UnwindSafe for RetroCameraBundle
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(
&self,
_images: &HashMap<Handle<Image>, <Image as RenderAsset>::PreparedAsset>,
) -> U
fn as_bind_group_shader_type( &self, _images: &HashMap<Handle<Image>, <Image as RenderAsset>::PreparedAsset>, ) -> U
Return the
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.