[][src]Struct cat_engine::PagedWindow

pub struct PagedWindow { /* fields omitted */ }

Окно, включает в себя графические функции и обработчик событий. Window with graphic functions and an event listener included.

Все события прописываются с помощь типажа WindowPage и обработываются сразу же после их появления.

All events are implemented with WindowPage and handled immediately after emited.

feature = "mouse_cursor_icon"

Замена обычного курсора пользовательской картинкой.

Путь для картинки по умолчанию - ./mouse_cursor_icon.png.

ImageBase для этой картинки добавляется в texture vertex buffer. Область по умочанию 4..8.

Replaces the default mouse cursor with user's image.

The cursor points to the center of the image.

The default path to the image is ./mouse_cursor_icon.png.

The ImageBase for the image binds to the texture vertex buffer. The default range is 4..8.

feature = "auto_hide"

При потере фокуса окно сворачивается, и выполняется функция on_focused. При получении фокуса окно возвращается в исходное состояние (функция on_focused тоже выполняется).

The window gets minimized when loses focus and the on_focused function is executed. The window gets back when it gains focus (the on_focused function is executed, too).

feature = "fps_counter"

Простой счётчик fps. Обновляется каждую секунду.

A simple fps counter. The value updates every second.

feature = "paged_format"

Заменяет обычную структуру окна на эту.

Replaces the default window struct with this one.

Implementations

impl Window[src]

pub fn new<F>(setting: F) -> Result<Window, DisplayCreationError> where
    F: FnOnce(Vec<MonitorHandle>, &mut WindowSettings), 
[src]

Создаёт окно. Принимает функцию для настройки.

Creates the window.

pub fn raw<P: AsRef<Path>>(
    window_builder: WindowBuilder,
    context_builder: ContextBuilder<NotCurrent>,
    graphics_settings: GraphicsSettings,
    event_loop: EventLoop<()>,
    initial_colour: Option<Colour>,
    mouse_cursor_icon_path: P,
    mouse_cursor_icon_range: Range<usize>
) -> Result<Window, DisplayCreationError>
[src]

mouse_cursor_icon_path - feature = "mouse_cursor_icon" mouse_cursor_icon_range - feature = "mouse_cursor_icon"

pub fn display(&self) -> &Display[src]

pub fn graphics(&mut self) -> &mut Graphics2D[src]

Возвращает графическую основу.

Returns graphic base.

pub fn available_monitors(&self) -> impl Iterator<Item = MonitorHandle>[src]

pub fn run<P: WindowPage>(&mut self, page: &mut P)[src]

Запускает данную страницу.

Starts the given page.

impl Window[src]

pub fn set_inner_size<S: Into<Size>>(&self, size: S)[src]

pub fn set_min_inner_size<S: Into<Size>>(&self, size: Option<S>)[src]

pub fn set_max_inner_size<S: Into<Size>>(&self, size: Option<S>)[src]

pub fn set_title(&self, title: &str)[src]

pub fn set_visible(&self, visible: bool)[src]

pub fn set_resizable(&self, resizable: bool)[src]

pub fn choose_fullscreen_monitor(&self, monitor: usize) -> Result<(), ()>[src]

pub fn set_fullscreen(&self, fullscreen: Option<Fullscreen>)[src]

pub fn set_minimized(&self, minimized: bool)[src]

Сворачивает окно.

Minimizes the window.

pub fn set_maximized(&self, maximized: bool)[src]

Делает окно максимального размера.

Maximizes the window.

pub fn set_decorations(&self, decorations: bool)[src]

pub fn set_always_on_top(&self, always_on_top: bool)[src]

pub fn set_cursor_visible(&mut self, visible: bool)[src]

pub fn switch_cursor_visibility(&mut self)[src]

impl Window[src]

impl Window[src]

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

Set alpha channel for smooth drawing.

pub fn set_smooth(&mut self, smooth: f32)[src]

Set smooth for smooth drawing.

pub fn set_new_smooth(&mut self, smooth: f32)[src]

Set smooth and zero alpha channel for smooth drawing.

impl Window[src]

pub fn draw_raw<F: FnOnce(&mut DrawParameters, &mut Frame)>(&self, f: F)[src]

Даёт прямое управление над кадром.

Gives the frame to raw drawing.

pub fn draw<F: FnOnce(&mut DrawParameters, &mut Graphics)>(&self, f: F)[src]

Выполняет замыкание (и рисует курсор, если feature="mouse_cursor_icon").

Executes the closure (and draws the mouse cursor if feature="mouse_cursor_icon").

pub fn draw_smooth<F: FnOnce(f32, &mut DrawParameters, &mut Graphics)>(
    &mut self,
    f: F
) -> f32
[src]

Выполняет замыкание (и рисует курсор, если feature="mouse_cursor_icon"). Выдаёт альфа-канал для рисования, возвращает следующее значение канала.

Нужна для плавных переходов или размытия с помощью альфа-канала.

Executes closure (and draws the mouse cursor if feature="mouse_cursor_icon"). Gives alpha channel for drawing, returns the next value of the channel.

Needed for smooth drawing or smoothing with alpha channel.

impl Window[src]

pub fn screenshot(&self) -> Option<DynamicImage>[src]

Возвращает скриншот.

Returns a screenshot.

pub fn save_screenshot<P: AsRef<Path>>(&self, path: P)[src]

Сохраняет скриншот в формате png.

Saves a screenshot in png format.

Auto Trait Implementations

impl !RefUnwindSafe for Window

impl !Send for Window

impl !Sync for Window

impl Unpin for Window

impl !UnwindSafe for Window

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.