njin
Engine 2D gọn nhẹ để tự tay làm game theo ý mình. Vibe coding cũng ổn luôn
Loading...
Searching...
No Matches
njin::ui_layout Struct Tham chiếu

Toàn bộ bố cục UI nạp từ file JSON hoặc xuất từ editor. Tiếp...

#include <njin_ui_layout.h>

Các hàm thành viên Public

ui_panel_data * find_panel (std::string_view panel_id)
 Tìm panel theo ID.
const ui_panel_data * find_panel (std::string_view panel_id) const
 Tìm panel theo ID.
ui_widget_data * find_widget (std::string_view widget_id)
 Tìm widget theo ID trên toàn bộ các panel.
const ui_widget_data * find_widget (std::string_view widget_id) const
 Tìm widget theo ID trên toàn bộ các panel.
ui_popup_data * find_popup (std::string_view popup_id)
 Tìm popup theo ID.
const ui_popup_data * find_popup (std::string_view popup_id) const
 Tìm popup theo ID.

Các thuộc tính Public

i32 version = 1
 Phiên bản cấu trúc data UI.
vec2 design_resolution {1280.0f, 720.0f}
 Độ phân giải thiết kế chuẩn.
ui_style style = ui_default_style()
 Style giao diện mặc định.
bool custom_style = false
 Có áp dụng custom style trong layout không.
std::vector< ui_panel_data > panels
 Danh sách các panel.
std::vector< ui_popup_data > popups
 Danh sách các popup.

Mô tả chi tiết

Toàn bộ bố cục UI nạp từ file JSON hoặc xuất từ editor.

Thông tin về hàm thành viên

◆ find_panel() [1/2]

ui_panel_data * njin::ui_layout::find_panel ( std::string_view panel_id)

Tìm panel theo ID.

Các tham số
panel_idID của panel.
Giá trị trả về
Con trỏ tới panel, hoặc nullptr nếu không có.

◆ find_panel() [2/2]

const ui_panel_data * njin::ui_layout::find_panel ( std::string_view panel_id) const

Tìm panel theo ID.

Các tham số
panel_idID của panel.
Giá trị trả về
Con trỏ tới panel, hoặc nullptr nếu không có.

◆ find_widget() [1/2]

ui_widget_data * njin::ui_layout::find_widget ( std::string_view widget_id)

Tìm widget theo ID trên toàn bộ các panel.

Các tham số
widget_idID của widget.
Giá trị trả về
Con trỏ tới widget đầu tiên có ID đó, hoặc nullptr nếu không có.

◆ find_widget() [2/2]

const ui_widget_data * njin::ui_layout::find_widget ( std::string_view widget_id) const

Tìm widget theo ID trên toàn bộ các panel.

Các tham số
widget_idID của widget.
Giá trị trả về
Con trỏ tới widget đầu tiên có ID đó, hoặc nullptr nếu không có.

◆ find_popup() [1/2]

ui_popup_data * njin::ui_layout::find_popup ( std::string_view popup_id)

Tìm popup theo ID.

Các tham số
popup_idID của popup.
Giá trị trả về
Con trỏ tới popup, hoặc nullptr nếu không có.

◆ find_popup() [2/2]

const ui_popup_data * njin::ui_layout::find_popup ( std::string_view popup_id) const

Tìm popup theo ID.

Các tham số
popup_idID của popup.
Giá trị trả về
Con trỏ tới popup, hoặc nullptr nếu không có.