Crate cat_engine

Source
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§

pub use glium;
pub use cat_audio as audio;
pub use image;

Modules§

graphics
Графические основы. Graphics bases.
shapes
Геометрические фигуры. Geometric shapes. feature = "simple_graphics", default_features
text
Рендеринг текста. Text rendering. feature = "text_graphics", default_features
texture
Основы работы с изображениями. Image basics.

Structs§

GeneralSettings
ModifiersState
Represents the current state of the keyboard modifiers
Window
Окно, которое использует “страницы” и замыкания для обработки событий. A window that uses ‘pages’ and closures to handle the events.
WindowSettings

Enums§

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

WindowPage
Типаж для создания страниц окна. 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]