Guild icon
Teeworlds
discord.gg/teeworlds / development
For discussions around the development of the official Teeworlds
Between 2020-12-10 00:00:00Z and 2020-12-11 00:00:00Z
Avatar
👀 basically the way of using CTextCursor changed. and some of the text logic changed.
03:21
Notably: 1. Text* calls (TextOutlined, TextShadowed and TextPlain) can not append text like TextEx did and should only be called once per cursor per frame. 2. You can append text by using the text layout routine, i.e. using TextDeferred to prepare text, TextAdvance to advance the cursor horizontally, and TextNewLine to advances the cursor vertically. The layout routine precalculate the quad textures and width, then you can draw the entrie cursor using DrawText*.
03:22
3. Text* calls really just a helper function to run the layout routine and draw it in one call. (edited)
03:27
4. Once you've prepared a CTextCursor using Text* or TextDeferred, the quad cache will only be cleared if you call CTextCursor::Clear(). That means you can save a CTextCursor instance somewhere and reuse it if your text rarely changes, which is actually preferred to render player names / player clans. If you don't care about caching / performance, just clear the cursor every time you're using it (edited)
Exported 4 message(s)