Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 3 commits into
base: standalone
Choose a base branch
from

Conversation

dany-on-demand
Copy link
Contributor

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

  • 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

// 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
Copy link
Contributor Author

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

Choose a reason for hiding this comment

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

scalex feels hacky... dunno

int i = 0;
while(chat_popup_line != NULL) {
char* next_line = strchr(chat_popup_line, '\n');
char chat_popup_temp[256];
Copy link
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?

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
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