[][src]Struct cat_engine::graphics::Graphics

pub struct Graphics<'graphics, 'frame> {
    pub graphics2d: &'graphics mut Graphics2D,
    pub frame: &'frame mut Frame,
}

Простой интерфейс для связи кадра и графических функций. Simple interface to connect graphics fuctions to the frame.

Fields

graphics2d: &'graphics mut Graphics2Dframe: &'frame mut Frame

Implementations

impl<'graphics, 'frame> Graphics<'graphics, 'frame>[src]

pub fn clear_colour(&mut self, [r, g, b, a]: [f32; 4])[src]

Заполняет окно данным цветом.

Fills the window with the given colour.

pub fn draw_object(
    &mut self,
    index: usize,
    object_type: ObjectType,
    draw_type: DrawType,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Рисует сохранённый объект.

Draws a saved object.

impl<'graphics, 'frame> Graphics<'graphics, 'frame>[src]

pub fn draw_simple<'o, O, V, I>(
    &mut self,
    object: &'o O,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError> where
    O: DependentObject<'o, Vertex2D, u8, Vertices = V, Indices = I>,
    V: AsRef<[Vertex2D]> + 'o,
    I: AsRef<[u8]> + 'o, 
[src]

Рисует простой объект.

Draws a simple object.

pub fn draw_shift_simple<'o, O, V, I>(
    &mut self,
    object: &'o O,
    shift: [f32; 2],
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError> where
    O: DependentObject<'o, Vertex2D, u8, Vertices = V, Indices = I>,
    V: AsRef<[Vertex2D]> + 'o,
    I: AsRef<[u8]> + 'o, 
[src]

Рисует сдвинутый простой объект.

Draws a shifted simple object.

pub fn draw_rotate_simple<'o, O, V, I>(
    &mut self,
    object: &'o O,
    rotation_center: [f32; 2],
    angle: f32,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError> where
    O: DependentObject<'o, Vertex2D, u8, Vertices = V, Indices = I>,
    V: AsRef<[Vertex2D]> + 'o,
    I: AsRef<[u8]> + 'o, 
[src]

Рисует повёрнутый простой объект.

Draws a rotated simple object.

pub fn draw_simple_general<'o, O, V, I>(
    &mut self,
    object: &'o O,
    draw_type: DrawType,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError> where
    O: DependentObject<'o, Vertex2D, u8, Vertices = V, Indices = I>,
    V: AsRef<[Vertex2D]> + 'o,
    I: AsRef<[u8]> + 'o, 
[src]

Рисует простой объект.

Draws a simple object.

impl<'graphics, 'frame> Graphics<'graphics, 'frame>[src]

pub fn draw_texture<'o, O, V, I>(
    &mut self,
    base: &'o O,
    texture: &Texture,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError> where
    O: DependentObject<'o, TexturedVertex2D, u8, Vertices = V, Indices = I>,
    V: AsRef<[TexturedVertex2D]> + 'o,
    I: AsRef<[u8]> + 'o, 
[src]

Рисует изображение.

Draws a texture.

pub fn draw_shift_texture<'o, O, V, I>(
    &mut self,
    base: &'o O,
    texture: &Texture,
    shift: [f32; 2],
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError> where
    O: DependentObject<'o, TexturedVertex2D, u8, Vertices = V, Indices = I>,
    V: AsRef<[TexturedVertex2D]> + 'o,
    I: AsRef<[u8]> + 'o, 
[src]

Рисует сдвинутую текстуру.

Draws a shifted texture.

pub fn draw_rotate_texture<'o, O, V, I>(
    &mut self,
    base: &'o O,
    texture: &Texture,
    rotation_center: [f32; 2],
    angle: f32,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError> where
    O: DependentObject<'o, TexturedVertex2D, u8, Vertices = V, Indices = I>,
    V: AsRef<[TexturedVertex2D]> + 'o,
    I: AsRef<[u8]> + 'o, 
[src]

Рисует повёрнутую текстуру.

Draws a rotated texture.

angle - radians

pub fn draw_texture_general<'o, O, V, I>(
    &mut self,
    base: &'o O,
    texture: &Texture,
    draw_type: DrawType,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError> where
    O: DependentObject<'o, TexturedVertex2D, u8, Vertices = V, Indices = I>,
    V: AsRef<[TexturedVertex2D]> + 'o,
    I: AsRef<[u8]> + 'o, 
[src]

Рисует текстуру.

Draws a texture.

impl<'graphics, 'frame> Graphics<'graphics, 'frame>[src]

pub fn draw_glyph(
    &mut self,
    glyph: PositionedGlyph<'_>,
    colour: Colour,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Выводит уже готовый символ.

Draws an already built glyph.

pub fn draw_shift_glyph(
    &mut self,
    glyph: PositionedGlyph<'_>,
    colour: Colour,
    shift: [f32; 2],
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Выводит сдвинутый, уже готовый символ.

Draws a shifted, already built glyph.

pub fn draw_rotate_glyph(
    &mut self,
    glyph: PositionedGlyph<'_>,
    colour: Colour,
    rotation_center: [f32; 2],
    angle: f32,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Выводит повёрнутый, уже готовый символ.

Draws a rotated, already built glyph.

pub fn draw_glyph_general(
    &mut self,
    glyph: PositionedGlyph<'_>,
    colour: Colour,
    draw_type: DrawType,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Выводит уже готовый символ.

Draws a already built glyph.

impl<'graphics, 'frame> Graphics<'graphics, 'frame>[src]

pub fn draw_simple_object(
    &mut self,
    index: usize,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Рисует простой объект.

Draws the saved simple object.

pub fn draw_shift_simple_object(
    &mut self,
    index: usize,
    shift: [f32; 2],
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Рисует сдвинутый простой объект.

Draws the shifted saved simple object.

pub fn draw_rotate_simple_object(
    &mut self,
    index: usize,
    rotation_center: [f32; 2],
    angle: f32,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Рисует повёрнутый простой объект.

Draws the rotated saved simple object.

pub fn draw_simple_object_general(
    &mut self,
    index: usize,
    draw_type: DrawType,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Рисует простой объект.

Draws the saved simple object.

impl<'graphics, 'frame> Graphics<'graphics, 'frame>[src]

pub fn draw_textured_object(
    &mut self,
    index: usize,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Рисует сохранённый текстурный объект.

Draws the saved textured object.

pub fn draw_shift_textured_object(
    &mut self,
    index: usize,
    shift: [f32; 2],
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Рисует сдвинутый сохранённый текстурный объект.

Draws the shifted saved textured object.

pub fn draw_rotate_textured_object(
    &mut self,
    index: usize,
    rotation_center: [f32; 2],
    angle: f32,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Рисует повёрнутый сохранённый текстурный объект.

Draws the rotated saved textured object.

rotation_center - [x, y] angle - radians

pub fn draw_textured_object_general(
    &mut self,
    index: usize,
    draw_type: DrawType,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Рисует сохранённый текстурный объект.

Draws the saved textured object.

impl<'graphics, 'frame> Graphics<'graphics, 'frame>[src]

pub fn draw_text_object(
    &mut self,
    index: usize,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Рисует сохранённый текстовой объект.

Draws the saved text object.

pub fn draw_shift_text_object(
    &mut self,
    index: usize,
    shift: [f32; 2],
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Рисует сохранённый текстовой объект.

Draws the saved text object.

pub fn draw_rotate_text_object(
    &mut self,
    index: usize,
    rotation_center: [f32; 2],
    angle: f32,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Рисует сохранённый текстовой объект.

Draws the saved text object.

pub fn draw_text_object_general(
    &mut self,
    index: usize,
    draw_type: DrawType,
    draw_parameters: &DrawParameters<'_>
) -> Result<(), DrawError>
[src]

Рисует сохранённый текстовой объект.

Draws the saved text object.

Auto Trait Implementations

impl<'graphics, 'frame> !RefUnwindSafe for Graphics<'graphics, 'frame>

impl<'graphics, 'frame> !Send for Graphics<'graphics, 'frame>

impl<'graphics, 'frame> !Sync for Graphics<'graphics, 'frame>

impl<'graphics, 'frame> Unpin for Graphics<'graphics, 'frame>

impl<'graphics, 'frame> !UnwindSafe for Graphics<'graphics, 'frame>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.