mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-12 01:08:04 +00:00
[Core] Update debug tools to include text alignment
This commit is contained in:
parent
d637e2a122
commit
e35bba079e
@ -96,6 +96,12 @@ TextWrapMode :: enum EnumBackingType {
|
|||||||
None,
|
None,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TextAlignment :: enum EnumBackingType {
|
||||||
|
Left,
|
||||||
|
Center,
|
||||||
|
Right,
|
||||||
|
}
|
||||||
|
|
||||||
TextElementConfig :: struct {
|
TextElementConfig :: struct {
|
||||||
textColor: Color,
|
textColor: Color,
|
||||||
fontId: u16,
|
fontId: u16,
|
||||||
@ -103,6 +109,7 @@ TextElementConfig :: struct {
|
|||||||
letterSpacing: u16,
|
letterSpacing: u16,
|
||||||
lineHeight: u16,
|
lineHeight: u16,
|
||||||
wrapMode: TextWrapMode,
|
wrapMode: TextWrapMode,
|
||||||
|
textAlignment: TextAlignment,
|
||||||
hashStringContents: bool,
|
hashStringContents: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
11
clay.h
11
clay.h
@ -3346,7 +3346,7 @@ void Clay__RenderDebugView(void) {
|
|||||||
// .letterSpacing
|
// .letterSpacing
|
||||||
CLAY_TEXT(CLAY_STRING("Letter Spacing"), infoTitleConfig);
|
CLAY_TEXT(CLAY_STRING("Letter Spacing"), infoTitleConfig);
|
||||||
CLAY_TEXT(Clay__IntToString(textConfig->letterSpacing), infoTextConfig);
|
CLAY_TEXT(Clay__IntToString(textConfig->letterSpacing), infoTextConfig);
|
||||||
// .lineSpacing
|
// .wrapMode
|
||||||
CLAY_TEXT(CLAY_STRING("Wrap Mode"), infoTitleConfig);
|
CLAY_TEXT(CLAY_STRING("Wrap Mode"), infoTitleConfig);
|
||||||
Clay_String wrapMode = CLAY_STRING("WORDS");
|
Clay_String wrapMode = CLAY_STRING("WORDS");
|
||||||
if (textConfig->wrapMode == CLAY_TEXT_WRAP_NONE) {
|
if (textConfig->wrapMode == CLAY_TEXT_WRAP_NONE) {
|
||||||
@ -3355,6 +3355,15 @@ void Clay__RenderDebugView(void) {
|
|||||||
wrapMode = CLAY_STRING("NEWLINES");
|
wrapMode = CLAY_STRING("NEWLINES");
|
||||||
}
|
}
|
||||||
CLAY_TEXT(wrapMode, infoTextConfig);
|
CLAY_TEXT(wrapMode, infoTextConfig);
|
||||||
|
// .textAlignment
|
||||||
|
CLAY_TEXT(CLAY_STRING("Text Alignment"), infoTitleConfig);
|
||||||
|
Clay_String textAlignment = CLAY_STRING("LEFT");
|
||||||
|
if (textConfig->textAlignment == CLAY_TEXT_ALIGN_CENTER) {
|
||||||
|
textAlignment = CLAY_STRING("CENTER");
|
||||||
|
} else if (textConfig->textAlignment == CLAY_TEXT_ALIGN_RIGHT) {
|
||||||
|
textAlignment = CLAY_STRING("RIGHT");
|
||||||
|
}
|
||||||
|
CLAY_TEXT(textAlignment, infoTextConfig);
|
||||||
// .textColor
|
// .textColor
|
||||||
CLAY_TEXT(CLAY_STRING("Text Color"), infoTitleConfig);
|
CLAY_TEXT(CLAY_STRING("Text Color"), infoTitleConfig);
|
||||||
Clay__RenderDebugViewColor(textConfig->textColor, infoTextConfig);
|
Clay__RenderDebugViewColor(textConfig->textColor, infoTextConfig);
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user