[][src]Struct cat_engine::Window

pub struct Window { /* fields omitted */ }

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

Все события обрабатываются и добавляются в очередь внешней обработки (Window.events) для работы с ними вне структуры окна.

All events are handled and added to the outer handling queue (Window.events) to work with them outside of the window structure.

feature = "mouse_cursor_icon"

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

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

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.

feature = "auto_hide"

При потере фокуса окно сворачивается, передача событий внешнему управлению прекращается (передаётся только события получения фокуса, приостановки и возобления приложения). При получении фокуса окно возвращается в исходное состояние.

The window gets minimized when loses focus and it stops sending outer events except gained focus and application suspended or resumed events. The window gets back when it gains focus.

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
) -> Result<Window, DisplayCreationError>
[src]

mouse_cursor_icon_path - 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 next_event(&mut self) -> Option<WindowEvent>[src]

Возвращает следующее событие окна.

Returns next window event.

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