[][src]Struct cat_engine::text::TextBase

pub struct TextBase {
    pub position: [f32; 2],
    pub font_size: f32,
    pub colour: Colour,
}

Основа для рендеринга текста. A base for text rendering.

Fields

position: [f32; 2]font_size: f32colour: Colour

Implementations

impl TextBase[src]

pub const fn new(position: [f32; 2], font_size: f32, colour: Colour) -> TextBase[src]

pub const fn zero_position(font_size: f32, colour: Colour) -> TextBase[src]

pub fn set_x(&mut self, x: f32)[src]

pub fn set_y(&mut self, y: f32)[src]

pub fn move_to(&mut self, position: [f32; 2])[src]

pub fn shift_x(&mut self, dx: f32)[src]

pub fn shift_y(&mut self, dy: f32)[src]

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

pub fn set_alpha_channel(&mut self, alpha: f32)[src]

pub fn set_colour(&mut self, colour: Colour)[src]

pub fn draw_char(
    &self,
    character: char,
    font: &Font<'_>,
    draw_parameters: &DrawParameters<'_>,
    graphics: &mut Graphics<'_, '_>
) -> Result<(), DrawError>
[src]

Строит и выводит один символ.

Builds and draws a glyph.

pub fn draw_rotate_char(
    &self,
    character: char,
    rotation_center: [f32; 2],
    angle: f32,
    font: &Font<'_>,
    draw_parameters: &DrawParameters<'_>,
    graphics: &mut Graphics<'_, '_>
) -> Result<(), DrawError>
[src]

Строит и выводит один символ.

Builds and draws a glyph.

pub fn draw_str(
    &self,
    s: &str,
    font: &Font<'_>,
    draw_parameters: &DrawParameters<'_>,
    graphics: &mut Graphics<'_, '_>
) -> Result<(), DrawError>
[src]

Выводит строку.

Draws a string.

pub fn draw_rotate_str(
    &self,
    s: &str,
    rotation_center: [f32; 2],
    angle: f32,
    font: &Font<'_>,
    draw_parameters: &DrawParameters<'_>,
    graphics: &mut Graphics<'_, '_>
) -> Result<(), DrawError>
[src]

Выводит повёрнутую строку.

Draws a rotated string.

pub fn draw_str_part(
    &self,
    s: &str,
    chars: usize,
    font: &Font<'_>,
    draw_parameters: &DrawParameters<'_>,
    graphics: &mut Graphics<'_, '_>
) -> Result<bool, DrawError>
[src]

Выводит часть строки. Если текст выведен полностью, возвращает true.

Draws a part of a string. Returns true, if the whole string is drawn.

pub fn draw_rotate_str_part(
    &self,
    s: &str,
    chars: usize,
    rotation_center: [f32; 2],
    angle: f32,
    font: &Font<'_>,
    draw_parameters: &DrawParameters<'_>,
    graphics: &mut Graphics<'_, '_>
) -> Result<bool, DrawError>
[src]

Выводит часть повёрнутой строки. Если текст выведен полностью, возвращает true.

Draws a part of a rotated string. Returns true, if the whole string is drawn.

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, 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.