[−][src]Crate cat_engine
2D графический движок с поддержкой аудио. A 2D graphics engine with audio support.
Использует OpenGL 2.0 и выше.
Текст рисуется поточечно. Так что важно указать правильный размер буфера.
Uses OpenGL 2.0 and above.
Text is drawn pointwise. It's important to set correct size of the text graphics buffer.
use cat_engine::{ DefaultWindow, Window, WindowEvent }; fn main(){ // Default settings let mut window=Window::new(|_,_|{}).unwrap(); while let Some(event)=window.next_event(){ match event{ WindowEvent::Exit=>break, WindowEvent::Draw=>{ 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; |
Modules
audio | Простая аудио система. A simple audio system. |
graphics | Графические основы. Graphics bases. |
shapes | Геометрические фигуры. Geometric shapes.
|
text | Основы работы с текстом. Text basics. |
texture | Основы работы с изображениями. Image basics. |
Structs
DefaultWindow | Окно с внешним обработчиком событий. A window with an outer event hanlder. |
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. |
MouseCursorIconSettings | |
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 | Ссылка на типаж-объект для |