Expand description
§2D графический движок с поддержкой аудио. A 2D graphics engine with audio support.
“Фичи” по умолчанию - audio
, simple_graphics
, texture_graphics
, text_graphics
.
The default features are audio
,simple_graphics
, texture_graphics
, text_graphics
.
use cat_engine::{
Window,
WindowEvent
};
fn main(){
// Default settings
let (mut window,graphics)=Window::new(|_,_|{}).unwrap();
window.run(|window,event|{
match event{
WindowEvent::RedrawRequested=>{
window.draw(&graphics,|graphics|{
graphics.clear_colour([1.0,0.0,0.0,0.0]);
}).unwrap();
}
_=>{}
}
});
}
Modifying a window.
let wi=window.display().gl_window();
let w=wi.window();
w.set_minimized(false);
w.set_visible(false);
Re-exports§
Modules§
- graphics
- Графические основы. Graphics bases.
- shapes
- Геометрические фигуры. Geometric shapes.
feature = "simple_graphics"
,default_features
- text
- Рендеринг текста. Text rendering.
feature = "text_graphics"
,default_features
- texture
- Основы работы с изображениями. Image basics.
Structs§
- General
Settings - Modifiers
State - Represents the current state of the keyboard modifiers
- Window
- Окно, которое использует “страницы” и замыкания для обработки событий. A window that uses ‘pages’ and closures to handle the events.
- Window
Settings
Enums§
- Keyboard
Button - Mouse
Button - Describes a button of a mouse controller.
- Mouse
Scroll Delta - Describes a difference in the mouse scroll wheel state.
- Window
Event - Внешние события окна. Outer window events.
Statics§
- fps
- Счётчик кадров в секунду. A frame per seconds counter.
feature = "fps_counter"
- mouse_
cursor - Положение курсора мыши. The mouse cursor position.
- ups
- Счётчик обновлений в секунду. An update per seconds counter.
feature = "ups_counter"
- window_
center - Центр окна. The window center. [x, y]
- window_
height - Высота окна. The window height.
- window_
width - Ширина окна. The window width.
Traits§
- Window
Page - Типаж для создания страниц окна. A trait for implementing window pages.
Functions§
- default_
draw_ parameters - window_
rect - Возвращает прямоугольник размера окна. Returns a window sized rectangle. [0, 0, width, height]
Type Aliases§
- Colour
- RGBA - [f32; 4]