Found a bug and probably few ways to boost it... I will post some change soon. I think i will communicate with the original author to see if i can publish a new version of his tool (with the original credits of course).

Im using jpct-ae since at least 1 year now and i want to contribute to the community. So i offer you guys this little addon to the GLFont lib. This is a way to say thank to Egon Olsen for his nice support.

I needed for my GUI to display text in multi line with color codes. So I worked on my Label object to add this features. It gave an horrible code with terrible performances and I quickly realized that I had to work directly in the GLFont class to get there.

The following code is not perfect. it work with a sacrifice of 20 FPS, so it is especially useful for text displays in the online help, credit pages or things like that. DO NOT USE IN A HUD.If you need to keep fps high, you have to use the usual method.

I really worked hard to improve it, but the use of regex (even compiled) slowed everything. It look like nothing, but i worked 3 evening on that thing...

Dont be shy to make change and you can easily add colors by adding the colors in the SwitchColor function and modifying the patternReplace pattern. Tell me if you see a way to optimize it.

How it work

Carriage return: You add a '|' in your string every time you want to do a carriage return. This function will also force a carriage return when you go past the bounds (with word wrap).

Color: You add a color code in your string to switch colors. Color codes are /#0 to /#9.

I think this happens because you are trying to add additional layers after the object has been compiled (and maybe stripped). This isn't supposed to work anyway, because it would require a recompile of the object. Have you tried to add that second layer right after loading the object and initialize it using some transparent texture?

woops... objects are already compiled and stripped when i change the texture. I had not seen it in the forum... or maybe im blind

Ok, so i have to destroy my object and then rebuild it with a new skin each time? Ill give a try.

i actually try to transform a texture when an object have a special status. In this case, a frozen card. So i have a normal texture for each cards and a icy texture of the same size using the same uv mapping format. My objects have their own UV Mapping (Using 3ds), in fact all cards use the same cloned object.