I renamed the class to Text.
Well it sure isn't done yet. If anyone's good with operators and want to post up some fixes go for it.
The float decimal on the line that sets the decimal its supposed to be
if n > float.minvalue not 0 that was a copy paste bug. I forgot to check Insert so im sure it generates trash.
Garbage wise, It works fine it you use it like in the example class.
Though im having a hell of a time making sure it works right with operator overloading.
Im not very good at it, in fact im pretty noob at it.
I want it to work like a regular string without garbage.
I really really want to be able to do calls like following and still not generate garbage.
SomeCall( a + b + c );
I can do the assignment calls
Text n = a + b +c;
But if its in some method i cant figure out how to do it with the operators without generating a ton of garbage,
trying to figure out a logical pattern to zero out the length of a temporary internal stringbuilder at the time of the actual equals or += assignment.
Zeroing out the temp length after the assignment occurs but it gets tricky.
Its fregging complicated im not sure what gets called when.
If i do something like this M( c + ( a + b)); i have the chain running down a temp stringbuilder thats fine if it is a sb call, but if its a text call, then it wants to make a new Text object via the constructor i think then pass the value of the reference, which will go out of scope in the method on return and have to get collected.
so i end up with something like this
txt_msg.Length = 0;
ww2s.DrawWithMsg(1, c2, false, txt_msg);
if i do this instead
ww2s.DrawWithMsg(1, c2, false, msg + txt_worldtoscreen);
can get it to do it without making a ton of garbage;
been at it all day arrrrrrggggggggggg.