Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

First character is misaligned for a single frame when starting to read a text with leftover

A topic by emongev created Jan 08, 2023 Views: 217 Replies: 3
Viewing posts 1 to 4

So I'm setting the text in an object, and while it starts reading and shows the first character, that first character is not correctly placed, then a frame later it moves to its correct position and it only happens when there is left over text, is there any way I can force it to calculate positions when I assign the text? Tried using Rebuild(), but it still happens.

Had to dig a little deeper, apparently it was that the "BaseOffset" was not being applied before displaying that character, so calling SetMesh(0f) right after setting the text apparently makes it go through the part of the code that applies that base offset and now it works! Sorry to have bothered!

Developer

I'll have to dig deeper into this in a bit, but I'm glad you found a workaround for the time being... I'm currently looking around in my source code trying to figure out exactly what I'm missing here on that first frame that SetMesh(0f) apparently does... I'm guessing it might have something to do with text's size property since that's used for calculating relative base offset but I'm not 100% sure... I'm going to keep looking!

Developer

I've had this page open in a pinned tab for a long long time now, and I still haven't been able to reproduce this at all... I'm pushing a new version of STM so hooopefully this is resolved with it...? If the issue is still persistent please let me know, and I'll look into it again!