diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-10-30 14:20:49 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-10-30 14:20:49 -0400 |
| commit | f99d6fd7226233c1f2e47c0f5f38737a72861fc9 (patch) | |
| tree | 0333c07aca0319504f29c79e2608124304d193d7 /src/static-ui.cpp | |
| parent | 9260a41bc6e0a430d1ab0bba004f86d1d5afd506 (diff) | |
pke: add flags to FontRenderSettings
Diffstat (limited to 'src/static-ui.cpp')
| -rw-r--r-- | src/static-ui.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/static-ui.cpp b/src/static-ui.cpp index 836966d..25c2514 100644 --- a/src/static-ui.cpp +++ b/src/static-ui.cpp @@ -385,12 +385,22 @@ bool pke_ui_calc_px(pk_arr_t<pke_ui_box_instance_buffer_item> &buffer, pk_arr_t< frs = FontType_GetFontRender(box->type_data->text.font_render_handle)->settings; frs.surface_area_pos = box->internal.px_corner; frs.surface_area_size = box->internal.px_size; + if (PK_HAS_FLAG(box->flags, PKE_UI_BOX_FLAG_VISIBILITY_INVISIBLE)) { + frs.flags = FONT_RENDER_FLAG(FONT_RENDER_FLAG_T(frs.flags) | FONT_RENDER_FLAG_T(FONT_RENDER_FLAG_VISIBILITY_INVISIBLE)); + } else { + frs.flags = FONT_RENDER_FLAG(FONT_RENDER_FLAG_T(frs.flags) & (~FONT_RENDER_FLAG_T(FONT_RENDER_FLAG_VISIBILITY_INVISIBLE))); + } FontType_UpdateStringRender(box->type_data->text.font_render_handle, &frs); break; case PKE_UI_BOX_TYPE_BUTTON_TEXT: frs = FontType_GetFontRender(box->type_data->button_text.font_render_handle)->settings; frs.surface_area_pos = box->internal.px_corner; frs.surface_area_size = box->internal.px_size; + if (PK_HAS_FLAG(box->flags, PKE_UI_BOX_FLAG_VISIBILITY_INVISIBLE)) { + frs.flags = FONT_RENDER_FLAG(FONT_RENDER_FLAG_T(frs.flags) | FONT_RENDER_FLAG_T(FONT_RENDER_FLAG_VISIBILITY_INVISIBLE)); + } else { + frs.flags = FONT_RENDER_FLAG(FONT_RENDER_FLAG_T(frs.flags) & (~FONT_RENDER_FLAG_T(FONT_RENDER_FLAG_VISIBILITY_INVISIBLE))); + } FontType_UpdateStringRender(box->type_data->button_text.font_render_handle, &frs); break; case PKE_UI_BOX_TYPE_BUTTON_IMAGE: |
