[demo] place hud down and in center

pull/1621/head
nick black 3 years ago
parent 745cbfb41b
commit c792b2e972
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -412,16 +412,15 @@ struct ncplane* hud_create(struct notcurses* nc){
int dimx, dimy; int dimx, dimy;
notcurses_term_dim_yx(nc, &dimy, &dimx); notcurses_term_dim_yx(nc, &dimy, &dimx);
struct ncplane_options nopts = { struct ncplane_options nopts = {
.y = 2, // FPS graph is 6 rows tall; we want one row above it
// we want it to start tucked right up underneath the title of the FPS .y = dimy - 6 - HUD_ROWS - 1,
// graph. graph is min(FPSGRAPH_MAX_COLS, dimx) wide, centered, and we want 6 in. .x = NCALIGN_CENTER,
.x = dimx - 2 - HUD_COLS,
.rows = HUD_ROWS, .rows = HUD_ROWS,
.cols = HUD_COLS, .cols = HUD_COLS,
.userptr = NULL, .userptr = NULL,
.name = "hud", .name = "hud",
.resizecb = NULL, .resizecb = NULL,
.flags = 0, .flags = NCPLANE_OPTION_HORALIGNED,
}; };
struct ncplane* n = ncplane_create(notcurses_stdplane(nc), &nopts); struct ncplane* n = ncplane_create(notcurses_stdplane(nc), &nopts);
if(n == NULL){ if(n == NULL){

Loading…
Cancel
Save