21 const char *
path =
nullptr;
audio_bus
Kênh trộn âm thanh, như thanh trượt trong menu cài đặt của game.
Definition njin_audio.h:17
@ bus_music
Nhạc nền (mọi music).
Definition njin_audio.h:19
std::int32_t i32
Số nguyên có dấu 32 bit.
Definition _types.h:14
float f32
Số thực 32 bit.
Definition _types.h:28
void video_set_loop(context &ctx, video_handle handle, bool loop)
Bật tắt phát lặp.
vec2 video_size(const context &ctx, video_handle handle)
Cỡ hình, pixel.
bool video_has_audio(const context &ctx, video_handle handle)
Video có phát tiếng không: file có tiếng, video_desc::audio bật và máy có thiết bị âm thanh.
void video_pause(context &ctx, video_handle handle)
Tạm dừng; hình đứng ở frame hiện tại.
void video_set_volume(context &ctx, video_handle handle, f32 volume)
Đặt âm lượng riêng của video, 0..1.
bool video_finished(const context &ctx, video_handle handle)
Video đã phát hết chưa (không lặp và đã đến cuối): lúc chuyển cảnh sau cutscene.
bool video_playing(const context &ctx, video_handle handle)
Video có đang phát không.
f32 video_time(const context &ctx, video_handle handle)
Đang ở giây thứ mấy.
f32 video_duration(const context &ctx, video_handle handle)
Video dài bao nhiêu giây.
void video_draw(const context &ctx, video_handle handle, rect dest, rgba tint={1.0f, 1.0f, 1.0f, 1.0f})
Vẽ frame hiện tại co giãn vào dest (2D, như texture_draw_ex()).
void video_seek(context &ctx, video_handle handle, f32 seconds)
Nhảy tới giây seconds.
i32 video_frame_count(const context &ctx, video_handle handle)
Số frame hình đã hiện kể từ khi mở (tăng cả khi tua): để biết hình đã đổi chưa.
f32 video_framerate(const context &ctx, video_handle handle)
Số frame hình mỗi giây của file.
void video_play(context &ctx, video_handle handle)
Phát tiếp (hoặc phát lại từ đầu nếu đã hết).
void video_draw_fit(const context &ctx, video_handle handle, rect area, rgba bars={0.0f, 0.0f, 0.0f, 1.0f})
Vẽ frame hiện tại vừa khít trong area, giữ tỉ lệ khung hình: phần thừa hai bên hay trên dưới tô bars ...
video_handle video_open(context &ctx, const video_desc &desc)
Mở một video.
void video_close(context &ctx, video_handle handle)
Đóng video, giải phóng texture và tiếng của nó.
texture_handle video_texture(const context &ctx, video_handle handle)
Texture chứa frame hình hiện tại.
Hình chữ nhật thẳng trục: pos là góc trên trái, size là rộng và cao.
Definition _math.h:13
Màu gồm đỏ, xanh lá, xanh dương và alpha.
Definition _types.h:64
Định danh của một texture, tạo bởi texture_load().
Definition _types.h:146
Vector 2 chiều. Dùng cho vị trí, kích thước, độ dời.
Definition _types.h:39
Cách mở một video bằng video_open().
Definition njin_video.h:20
bool audio
Phát tiếng (nếu file có tiếng và máy có thiết bị âm thanh).
Definition njin_video.h:24
f32 volume
Âm lượng riêng, 0..1, nhân với kênh và bus_master.
Definition njin_video.h:26
bool play
Phát ngay khi mở. false là mở rồi đứng ở hình đầu.
Definition njin_video.h:23
bool loop
Hết thì phát lại từ đầu.
Definition njin_video.h:22
audio_bus bus
Kênh âm lượng của tiếng (audio_set_bus_volume()).
Definition njin_video.h:25
const char * path
File .mpg, tìm như mọi asset.
Definition njin_video.h:21
Định danh của một video, mở bởi video_open().
Definition _types.h:293