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

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

Основа для текста с установленным цветом и размером шрифта. Сам шрифт задаётся отдельно во время вывода.

A base for text with set colour and font_size. The font is set at drawing.

Fields

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

Implementations

impl TextBase[src]

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

pub const fn position(self, position: [f32; 2]) -> TextBase[src]

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

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

pub fn set_position(&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_character(
    &self,
    character: &Character,
    draw_parameters: &mut DrawParameters,
    graphics: &mut Graphics
) -> Result<(), DrawError>
[src]

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

Draws already built character.

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

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

Builds and draws a character.

pub fn draw(
    &self,
    text: &str,
    draw_parameters: &mut DrawParameters,
    graphics: &mut Graphics,
    glyphs: &Glyphs
) -> Result<(), DrawError>
[src]

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

Draws a string.

pub fn draw_part(
    &self,
    text: &str,
    chars: usize,
    draw_parameters: &mut DrawParameters,
    graphics: &mut Graphics,
    glyphs: &Glyphs
) -> Result<bool, DrawError>
[src]

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

Draws a part of the string. Returns true, if the whole string was 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.