mirror of
https://github.com/Not-Nik/raylib-zig.git
synced 2025-09-09 03:57:29 +00:00
Make panel text optional (#109)
This commit is contained in:
parent
18a7daa631
commit
fb11a4e1c8
@ -338,7 +338,9 @@ def parse_header(header_name: str, output_file: str, ext_file: str, prefix: str,
|
||||
"DrawTriangleStrip",
|
||||
"DrawTriangleStrip3D",
|
||||
"GuiTabBar",
|
||||
"GuiListViewEx"
|
||||
"GuiListViewEx",
|
||||
"GuiPanel",
|
||||
"GuiScrollPanel"
|
||||
]
|
||||
|
||||
if func_name in manual or "FromMemory" in func_name:
|
||||
|
@ -435,3 +435,19 @@ pub fn guiTabBar(bounds: Rectangle, text: [][:0]const u8, active: *i32) i32 {
|
||||
pub fn guiListViewEx(bounds: Rectangle, text: [][:0]const u8, scrollIndex: *i32, active: *i32, focus: *i32) i32 {
|
||||
return @as(i32, cdef.GuiListViewEx(bounds, @as([*c][*c]const u8, @ptrCast(text)), @as(c_int, @intCast(text.len)), @as([*c]c_int, @ptrCast(scrollIndex)), @as([*c]c_int, @ptrCast(active)), @as([*c]c_int, @ptrCast(focus))));
|
||||
}
|
||||
|
||||
pub fn guiPanel(bounds: Rectangle, text: ?[:0]const u8) i32 {
|
||||
var textFinal = @as([*c]const u8, 0);
|
||||
if (text) |textSure| {
|
||||
textFinal = @as([*c]const u8, @ptrCast(textSure));
|
||||
}
|
||||
return @as(i32, cdef.GuiPanel(bounds, textFinal));
|
||||
}
|
||||
|
||||
pub fn guiScrollPanel(bounds: Rectangle, text: ?[:0]const u8, content: Rectangle, scroll: *Vector2, view: *Rectangle) i32 {
|
||||
var textFinal = @as([*c]const u8, 0);
|
||||
if (text) |textSure| {
|
||||
textFinal = @as([*c]const u8, @ptrCast(textSure));
|
||||
}
|
||||
return @as(i32, cdef.GuiScrollPanel(bounds, textFinal, content, @as([*c]Vector2, @ptrCast(scroll)), @as([*c]Rectangle, @ptrCast(view))));
|
||||
}
|
||||
|
@ -436,6 +436,22 @@ pub fn guiListViewEx(bounds: Rectangle, text: [][:0]const u8, scrollIndex: *i32,
|
||||
return @as(i32, cdef.GuiListViewEx(bounds, @as([*c][*c]const u8, @ptrCast(text)), @as(c_int, @intCast(text.len)), @as([*c]c_int, @ptrCast(scrollIndex)), @as([*c]c_int, @ptrCast(active)), @as([*c]c_int, @ptrCast(focus))));
|
||||
}
|
||||
|
||||
pub fn guiPanel(bounds: Rectangle, text: ?[:0]const u8) i32 {
|
||||
var textFinal = @as([*c]const u8, 0);
|
||||
if (text) |textSure| {
|
||||
textFinal = @as([*c]const u8, @ptrCast(textSure));
|
||||
}
|
||||
return @as(i32, cdef.GuiPanel(bounds, textFinal));
|
||||
}
|
||||
|
||||
pub fn guiScrollPanel(bounds: Rectangle, text: ?[:0]const u8, content: Rectangle, scroll: *Vector2, view: *Rectangle) i32 {
|
||||
var textFinal = @as([*c]const u8, 0);
|
||||
if (text) |textSure| {
|
||||
textFinal = @as([*c]const u8, @ptrCast(textSure));
|
||||
}
|
||||
return @as(i32, cdef.GuiScrollPanel(bounds, textFinal, content, @as([*c]Vector2, @ptrCast(scroll)), @as([*c]Rectangle, @ptrCast(view))));
|
||||
}
|
||||
|
||||
pub fn guiEnable() void {
|
||||
cdef.GuiEnable();
|
||||
}
|
||||
@ -528,14 +544,6 @@ pub fn guiLine(bounds: Rectangle, text: [:0]const u8) i32 {
|
||||
return @as(i32, cdef.GuiLine(bounds, @as([*c]const u8, @ptrCast(text))));
|
||||
}
|
||||
|
||||
pub fn guiPanel(bounds: Rectangle, text: [:0]const u8) i32 {
|
||||
return @as(i32, cdef.GuiPanel(bounds, @as([*c]const u8, @ptrCast(text))));
|
||||
}
|
||||
|
||||
pub fn guiScrollPanel(bounds: Rectangle, text: [:0]const u8, content: Rectangle, scroll: *Vector2, view: *Rectangle) i32 {
|
||||
return @as(i32, cdef.GuiScrollPanel(bounds, @as([*c]const u8, @ptrCast(text)), content, @as([*c]Vector2, @ptrCast(scroll)), @as([*c]Rectangle, @ptrCast(view))));
|
||||
}
|
||||
|
||||
pub fn guiLabel(bounds: Rectangle, text: [:0]const u8) i32 {
|
||||
return @as(i32, cdef.GuiLabel(bounds, @as([*c]const u8, @ptrCast(text))));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user