Half-Life и Adrenaline Gamer форум http://aghl.ru/forum/ |
|
HLSDK (Client) newline hud http://aghl.ru/forum/viewtopic.php?f=20&t=2584 |
Страница 1 из 1 |
Автор: | Gennaro-HL [ 25 окт 2016, 15:14 ] |
Заголовок сообщения: | HLSDK (Client) newline hud |
Hello, I have a problem with line break when the string contains color codes the message is moved to the left. You can remove the color codes without losing the colors in the hud? Image: As I can get the same effect as this: Код:
|
Автор: | Lev [ 25 окт 2016, 19:52 ] |
Заголовок сообщения: | Re: HLSDK (Client) newline hud |
That is probably because it counts chars to align text on the center and it count color codes like they will be printed, but you remove them on output, so text is aligned to the left. You should remove color codes when counting line length (do not count them). |
Автор: | Gennaro-HL [ 27 окт 2016, 03:09 ] |
Заголовок сообщения: | Re: HLSDK (Client) newline hud |
some example? this will I have to remove the colored codes (int line_length = 0;) |
Автор: | Gennaro-HL [ 13 ноя 2016, 05:46 ] |
Заголовок сообщения: | Re: HLSDK (Client) newline hud |
Can somebody help me I can not find a solution |
Автор: | Lev [ 13 ноя 2016, 10:54 ] |
Заголовок сообщения: | Re: HLSDK (Client) newline hud |
Not sure what your problem exactly. Probably that your colored text isn't aligned well. If it is, then you need to fix it here: Код: for (next_line = sz; *next_line != '\n' && *next_line != 0; next_line++)Do not count color codes here. Like so: Код: for (next_line = sz; *next_line != '\n' && *next_line != 0; next_line++)But it should be the same as your code that outputs text converting color codes into colors. |
Автор: | Gennaro-HL [ 14 ноя 2016, 19:13 ] |
Заголовок сообщения: | Re: HLSDK (Client) newline hud |
Look My problem is that text with color does not line up well when you do the line break example: DEFAULT CODE CURRENT CODE: Did I do something wrong? Код: //The effect I want Result: |
Автор: | Lev [ 14 ноя 2016, 23:41 ] |
Заголовок сообщения: | Re: HLSDK (Client) newline hud |
Sorry, forgotten quotes Код: (*(next_line + 1) >= 0 && *(next_line + 1) <= 9) Код: (*(next_line + 1) >= '0' && *(next_line + 1) <= '9') |
Автор: | Gennaro-HL [ 15 ноя 2016, 14:10 ] |
Заголовок сообщения: | Re: HLSDK (Client) newline hud |
thank you |
Страница 1 из 1 | Часовой пояс: UTC + 5 часов [ Летнее время ] |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |