Struct bevy_canvas::Canvas [−][src]
pub struct Canvas { /* fields omitted */ }
A Bevy Resource
that exposes an immediate mode 2D rendering API.
Usage
use bevy::prelude::*; use bevy_canvas::{ common_shapes::{Rectangle, RectangleAnchor}, Canvas, DrawMode, StrokeOptions, }; // In your system, fetch Canvas as a mutable resource: fn my_system(mut canvas: ResMut<Canvas>) { // Create a shape... let square = Rectangle { origin: Vec2::ZERO, extents: Vec2::splat(100.0), anchor_point: RectangleAnchor::TopLeft, }; // ...then draw it! canvas.draw(&square, DrawMode::fill_simple(), Color::RED); }
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Canvas
impl RefUnwindSafe for Canvas
impl UnwindSafe for Canvas
impl UnwindSafe for Canvas
Blanket Implementations
impl<T> Any for T where
T: Any,
impl<T> Any for T where
T: Any,
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
impl<T> FromWorld for T where
T: Default,
impl<T> FromWorld for T where
T: Default,
pub fn from_world(_world: &mut World) -> T
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,