[][src]Struct cat_engine::image::ImageBase

pub struct ImageBase {
    pub x1: f32,
    pub y1: f32,
    pub x2: f32,
    pub y2: f32,
    pub colour_filter: Colour,
}

Основа для изображений (текстур). Image (texture) base.

Прямоугольник с вершинами: (x1, y1), (x1, y2), (x2, y1), (x2, y2).

Цветовой фильтр - [red, green, blue, alpha]. Цвет = цвет * фильтр.

Изменённая система координат - начало в центре окна, ось Y инвертирована.

Rectangle with vertexes: (x1, y1), (x1, y2), (x2, y1), (x2, y2).

Colour filter - [red, green, blue, alpha]. Colour = colour * filter.

The coordinate system is changed: the origin is at the center of the window, the Y axe is reversed.

Fields

x1: f32y1: f32x2: f32y2: f32colour_filter: Colour

Implementations

impl ImageBase[src]

pub fn new(colour_filter: Colour, rect: [f32; 4]) -> ImageBase[src]

rect with the common coordinate system- [x,y,width,height]

pub fn set_rect(&mut self, rect: [f32; 4])[src]

rect with the common coordinate system - [x,y,width,height]

pub fn shift(&mut self, [dx, dy]: [f32; 2])[src]

Сдвигает координаты.

Shifts coordinates.

pub fn draw(
    &self,
    texture: &Texture,
    draw_parameters: &mut DrawParameters,
    graphics: &mut Graphics
)
[src]

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

Draws the image.

pub fn draw_shift(
    &self,
    texture: &Texture,
    shift: [f32; 2],
    draw_parameters: &mut DrawParameters,
    graphics: &mut Graphics
)
[src]

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

Draws shifted image.

pub fn draw_rotate(
    &self,
    texture: &Texture,
    angle: f32,
    draw_parameters: &mut DrawParameters,
    graphics: &mut Graphics
)
[src]

Рисует изображение под углом.

Draws rotated image.

Trait Implementations

impl Clone for ImageBase[src]

Auto Trait Implementations

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.