[−][src]Crate cat_engine
2D графический движок с поддержкой аудио. A 2D graphics engine with audio support.
"Фичи" по умолчанию - simple_graphics, texture_graphics, text_graphics.
The defealt features are simple_graphics, texture_graphics, text_graphics.
use cat_engine::{ PagedWindow, Window, WindowEvent }; fn main(){ // Default settings let mut window=PagedWindow::new(|_,_|{}).unwrap(); window.run(|window,event|{ match event{ WindowEvent::RedrawRequested=>{ window.draw(|_,g|{ g.clear_colour([1.0,0.0,0.0,0.0]); }).unwrap(); } _=>{} } }); }
Modifying the window.
let wi=window.display().gl_window(); let w=wi.window(); w.set_minimized(false); w.set_visible(false);
Re-exports
pub use glium; |
pub use cat_audio as audio; |
pub use image; |
Modules
| graphics | Графические основы. Graphics bases. |
| shapes | Геометрические фигуры. Geometric shapes.
|
| text | Общий модуль для функций или типов, неотносящихся ни к одному из других модулей. |
| texture | Основы работы с изображениями. Image basics. |
Structs
| DynamicWindow | Окно, которое использует "страницы" как типажи-объекты для обработки событий. A window that uses 'pages' as trait objects to handle the events. |
| GeneralSettings | |
| ModifiersState | Represents the current state of the keyboard modifiers |
| MouseCursor | Положение курсора мыши. The mouse cursor position. |
| PagedWindow | Окно, которое использует "страницы" и замыкания для обработки событий. A window that uses 'pages' and closures to handle the events. |
| WindowBase | Основа для окон для создания более сложных окон. A window base for creating more complex windows. |
| WindowSettings |
Enums
| InnerWindowEvent | Внутренние события для управления окном. Inner events to operate the window. |
| KeyboardButton | |
| MouseButton | Describes a button of a mouse controller. |
| MouseScrollDelta | Describes a difference in the mouse scroll wheel state. |
| WindowEvent | Внешние события окна. Outer window events. |
Statics
| fps | Счётчик кадров в секунду. A frame per seconds counter. feature = "fps_counter" |
| mouse_cursor | Положение курсора мыши. The mouse cursor position. |
| window_center | Центр окна. The window center. [x, y] |
| window_height | Высота окна. The window height. |
| window_width | Ширина окна. The window width. |
Traits
| Window | Типаж, помогающий создать более сложное окно на базе |
| WindowPage | Типаж для создания страниц окна. A trait for implementing window pages. |
Functions
| window_rect | Возвращает прямоугольник размера окна. Returns a window sized rectangle. [0, 0, width, height] |
Type Definitions
| Colour | RGBA - [f32; 4] |
| PageRef | Ссылка на типаж-объект для |