I just started using SDL2_ttf . I figured out how to get the text on the screen using TTF_RenderText_Blended , but how can I get it to do line breaks and auto-wrapping?
SDL2_ttf
TTF_RenderText_Blended
\n
Instead of TTF_RenderText_Blended use TTF_RenderText_Blended_Wrapped . An additional parameter is required: the width in pixels, after which the text will be split into the next line.
TTF_RenderText_Blended_Wrapped
SDL_TTF does not wrap, you must write your own.
TTF_Font* ttf; TTF_SizeText(ttf, "Hello World", &w, &h);
gives the width and height of the line.
Source: https://habr.com/ru/post/950222/More articles:https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/950217/adding-attributes-to-a-jar-files-manifest-using-gradle&usg=ALkJrhh2TBpKpDuZTDA8NJrIDKWDNsTJEgMVC controller returning encoding with fragmented content - asp.netWhat security rights does Jython need to successfully execute untrusted Python code? - securityCan someone explain this decorator code to me? - pythonColumn-based sorting and deletion - sortingDownload git submodules for tarball - gitBootstrap popup window not working - drop-down-menuHow can you call an explicitly declared member of an interface in a base class from a subclass? - overridePassing an implicit ExecutionContext to contained objects / called methods - scalaThe Google Geocoding API returns an invalid address, but Google maps show the correct location - google-mapsAll Articles