-
-
Notifications
You must be signed in to change notification settings - Fork 301
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
Text-styling properties configuration #328
Comments
Some more info while investigating those properties: At this moment GuiSetStyle(TEXTBOX, TEXT_PADDING, 4); // OK: text inner padding from bounds
GuiSetStyle(STATUSBAR, TEXT_PADDING, 8); // OK: text inner padding from bounds -> TEXT_INDENTATION?
GuiSetStyle(SLIDER, TEXT_PADDING, 4); // WARNING: Padding refers to outside label spacing -> LABEL_SEPARATION (using TEXT_PADDING for label text internal content)
GuiSetStyle(PROGRESSBAR, TEXT_PADDING, 4); // WARNING: Padding refers to outside label spacing -> LABEL_SEPARATION
GuiSetStyle(CHECKBOX, TEXT_PADDING, 4); // WARNING: Padding refers to outside label spacing -> LABEL_SEPARATION
GuiSetStyle(LABEL, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); // OK: text alignment inside text-bounds
GuiSetStyle(TEXTBOX, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); // OK: text alignment inside text-bounds
GuiSetStyle(STATUSBAR, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); // OK: text alignment inside text-bounds
GuiSetStyle(VALUEBOX, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); // WARNING: Text alignment refers to label side on control -> LABEL_SIDE: 0-left, 1-right
GuiSetStyle(SPINNER, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); // WARNING: Text alignment refers to label side on control -> LABEL_SIDE: 0-left, 1-right
GuiSetStyle(CHECKBOX, TEXT_ALIGNMENT, TEXT_ALIGN_RIGHT); // WARNING: Text alignment refers to label side on control -> LABEL_SIDE: 0-left, 1-right Noted that |
Still thinking about this issue. Just noticed that for controls not containing text inside the control bounds ( On the other side, controls actually containing some text inside the control ( |
I find it confusing to have both global and per control settings. My solution is to make all properties apply globally and per control. That way, we get rid of the confusing. Or prefix global properties with a letter like |
Beside the font used, raygui supports multiple text-styling properties for controls text drawing. At this moment some text-styling properties can be configured by-control while some other properties are global for all controls.
Per-control properties:
TEXT_PADDING
: Control text padding, not considering borderTEXT_ALIGNMENT
: Control text horizontal alignment inside control text bound (after border and padding)Global properties:
TEXT_SIZE
: Text size (glyphs max height)TEXT_SPACING
: Text spacing between glyphsTEXT_LINE_SPACING
: Text spacing between linesTEXT_ALIGNMENT_VERTICAL
: Text vertical alignment inside text bounds (after border and padding)TEXT_WRAP_MODE
: Text wrap-mode inside text boundsIn any case, those properties can be set by user before drawing each control for a per-control configuration but in the case of per-control properties they are saved individually with the style while with the global properties they must be set at runtime depending on the user needs.
Also, all those properties determine how
GetTextBounds()
is calculated and howGuiDrawText()
behaves (functions used by all controls).I'm considering unifying all those properties per-control or global but I'm seing multiple issues... because some current per-control properties should probably stay configured per control...
The text was updated successfully, but these errors were encountered: