Open JRMurr opened 3 months ago
Actually i think all of the enums that end with Property
are valid here. I think it depends on what control value you pass in for the first param (but not fully positive).
Maybe this func should be reverted to the old raw c_int style and we make our own wrapper api thats nested enum based?
This could just be resolved with anytype
and casting, but we loose type safety. I'll look into possible comptime assertions to fix this. Thanks
I believe with the changes made in #125 you can no longer set any default properties like changing the text_size
, right? The control was made raygui.GuiState
, but shouldn't it be raygui.GuiControl
?
I just ran into this issue trying to set default text size. There is no way of doing this now if I am not mistaken?
pub fn guiSetStyle(control: GuiState, property: GuiControlProperty, value: i32) void {
cdef.GuiSetStyle(control, property, @as(c_int, value));
}
How can I pass GuiDefaultProperty.text_size to this function?
I've reverted the API back to taking i32
for now, so any property can be passed with a single cast. I'll hopefully find some more time to investigate this, in October
In #125 I think the proposed api is wrong.
The first param should be
rg.GuiControl
and the second param is slightly weird.It can be
rg.GuiControlProperty
orrg.GuiDefaultProperty
. I'm newish to zig still so not sure the best way to handle merging these two enums together, maybe we have two different wrapper funcs for this?