Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button BORDER_WIDTH is not being saved into rgs file #8

Open
ssoher opened this issue Apr 2, 2024 · 5 comments
Open

Button BORDER_WIDTH is not being saved into rgs file #8

ssoher opened this issue Apr 2, 2024 · 5 comments

Comments

@ssoher
Copy link

ssoher commented Apr 2, 2024

rGuiStyler may not be saving the button border width to the rgs file. After loading the style and making sure that guiStyleLoaded is true, GuiGetStyle(BUTTON, BORDER_WIDTH) always returns 2 even though it was set to 1 and saved.

@raysan5
Copy link
Owner

raysan5 commented Apr 3, 2024

I think the issue is related to raygui lazy initialization that overwrites button border width. How are you loading the new gui style?

@ssoher
Copy link
Author

ssoher commented Apr 3, 2024

GuiLoadStyle("./asset/gui_style/gui_style.rgs"); in the main function after I raylib InitWindow, before entering the main loop

raysan5 added a commit to raysan5/raygui that referenced this issue Apr 3, 2024
…uistyler#8

Make sure default style has been loaded to avoid overwriting new style properties due to the lazy initialization of default style.
@raysan5
Copy link
Owner

raysan5 commented Apr 3, 2024

@ssoher I updated raygui, now it should work as expected, please, could you try it?

@ssoher
Copy link
Author

ssoher commented Apr 3, 2024

Thank you @raysan5

  • Opened my style to make sure button width is 1, it shows up as 2. Made it 1 and save. Closed rGuiStyler, re-opened, opened the same style file and button border width is reset back to 2 again.
  • Pulled the latest raygui commit (raysan5/raygui@e3f67f3) built my application, borders load up as 2.

I feel it has something to do with rGuiStyle serialization code but it's just a guess, didn't look at the code myself.

@ssoher
Copy link
Author

ssoher commented Apr 3, 2024

Here is the rgs file I'm observing this problem with if it helps you debug

gui_style.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants