Skip to content

[feedback welcome] fit chat_big/info/etc. in window - #193

Draft
dany-on-demand wants to merge 3 commits into
xtreme8000:standalonefrom
dany-on-demand:fix-big-chat
Draft

[feedback welcome] fit chat_big/info/etc. in window#193
dany-on-demand wants to merge 3 commits into
xtreme8000:standalonefrom
dany-on-demand:fix-big-chat

Conversation

@dany-on-demand

@dany-on-demand dany-on-demand commented Jan 14, 2024

Copy link
Copy Markdown
Contributor
  • BeS now tries to fit CHAT_BIG et al on the screen
  • will even try to split it into newlines based on spaces in the text (not limited to number of lines)
  • fixed a bug where settings->window_width/height were 0 for a portion of game logic run after hitting fullscreen (see reshape in main.c)
  • defined BIG_TEXT_SIZE 53.0F
  • a few whitespace changes due to autoformat

scalex situation in font_fit_height works but feels hacky

image
image

Comment thread src/font.c
// newlines

float font_fit_height(int max_width, float starting_height, char* text) {
float scalex = max_width / 800.0F; // not sure if I should consider this a hacky solution

@dany-on-demand dany-on-demand Jan 14, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scalex feels hacky... dunno

Comment thread src/hud.c
int i = 0;
while(chat_popup_line != NULL) {
char* next_line = strchr(chat_popup_line, '\n');
char chat_popup_temp[256];

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a better way?

Comment thread src/hud.c
strcpy(chat_popup_temp, chat_popup_line);
chat_popup_line = NULL;
}
float text_pixel_width = font_length(chat_popup_height, chat_popup_temp);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this value could be 'cached' too

@dany-on-demand dany-on-demand changed the title [do not merge] fit chat_big/info/etc. in window [feedback welcome] fit chat_big/info/etc. in window Jan 21, 2024
@dany-on-demand
dany-on-demand marked this pull request as draft January 23, 2024 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant