Add position options to place the overlay halfway down the screen (#561)

libdrm_amdgpu
Joshua Martin 3 years ago committed by GitHub
parent 564c254eea
commit 3b0b6fbc42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -162,7 +162,7 @@ Parameters that are enabled by default have to be explicitly disabled. These (cu
| `font_glyph_ranges` | Specify extra font glyph ranges, comma separated: `korean`, `chinese`, `chinese_simplified`, `japanese`, `cyrillic`, `thai`, `vietnamese`, `latin_ext_a`, `latin_ext_b`. If you experience crashes or text is just squares, reduce font size or glyph ranges. |
| `no_small_font` | Use primary font size for smaller text like units |
| `width=`<br>`height=` | Customizeable hud dimensions (in pixels) |
| `position=` | Location of the hud: `top-left` (default), `top-right`, `bottom-left`, `bottom-right`, `top-center` |
| `position=` | Location of the hud: `top-left` (default), `top-right`, `middle-left`, `middle-right`, `bottom-left`, `bottom-right`, `top-center` |
| `offset_x` `offset_y` | Hud position offsets |
| `no_display` | Hide the hud by default |
| `toggle_hud=`<br>`toggle_logging=` | Modifiable toggle hotkeys. Default are `Shift_R+F12` and `Shift_L+F2`, respectively. |

@ -190,6 +190,14 @@ void position_layer(struct swapchain_stats& data, struct overlay_params& params,
data.main_window_pos = ImVec2(width - window_size.x - margin + params.offset_x, margin + params.offset_y);
ImGui::SetNextWindowPos(data.main_window_pos, ImGuiCond_Always);
break;
case LAYER_POSITION_MIDDLE_LEFT:
data.main_window_pos = ImVec2(margin + params.offset_x, height / 2 - window_size.y / 2 - margin + params.offset_y);
ImGui::SetNextWindowPos(data.main_window_pos, ImGuiCond_Always);
break;
case LAYER_POSITION_MIDDLE_RIGHT:
data.main_window_pos = ImVec2(width - window_size.x - margin + params.offset_x, height / 2 - window_size.y / 2 - margin + params.offset_y);
ImGui::SetNextWindowPos(data.main_window_pos, ImGuiCond_Always);
break;
case LAYER_POSITION_BOTTOM_LEFT:
data.main_window_pos = ImVec2(margin + params.offset_x, height - window_size.y - margin + params.offset_y);
ImGui::SetNextWindowPos(data.main_window_pos, ImGuiCond_Always);

@ -74,6 +74,10 @@ parse_position(const char *str)
return LAYER_POSITION_TOP_LEFT;
if (!strcmp(str, "top-right"))
return LAYER_POSITION_TOP_RIGHT;
if (!strcmp(str, "middle-left"))
return LAYER_POSITION_MIDDLE_LEFT;
if (!strcmp(str, "middle-right"))
return LAYER_POSITION_MIDDLE_RIGHT;
if (!strcmp(str, "bottom-left"))
return LAYER_POSITION_BOTTOM_LEFT;
if (!strcmp(str, "bottom-right"))

@ -143,6 +143,8 @@ typedef unsigned long KeySym;
enum overlay_param_position {
LAYER_POSITION_TOP_LEFT,
LAYER_POSITION_TOP_RIGHT,
LAYER_POSITION_MIDDLE_LEFT,
LAYER_POSITION_MIDDLE_RIGHT,
LAYER_POSITION_BOTTOM_LEFT,
LAYER_POSITION_BOTTOM_RIGHT,
LAYER_POSITION_TOP_CENTER,

Loading…
Cancel
Save