- Home /
clearing dynamic font texture on font size change
so i got an input field UI element in my game, that field can take up to 10000 characters AND the user can use a slider to change the font size of all the text in the text UI component.
The problem is this causes the following error if i got too many different characters as soon as i change the font size: ArgumentOutOfRangeException: Argument is out of range. Parameter name: index
This is because unity generates new textures to put in the font texture every time i use a new font size and it runs out of texture space(2048x2048) on fones.
How do i clear this texture through script whenever i change the font size so that i never get the error?
I have no idea how that stuff works.
I got the textmesh pro plugin that uses a different text rendering technique that doesn't dynamically recreate the texture when font size changes, but the creator still hasn't implemented the input field component for the plugin. so i either wait for him to finish or see if there's any other solution.
Any help is very appreciated :) this is like my last obstacle stopping me from completing the program.