Fast method to scale text
Posted: Sat Aug 20, 2011 01:27
I basically am trying to make a picture-in-picture type of mode for my game.
I have a window thats usually 100% of the parent's size and i shrink it down to 75%.
This automatically scales down the images but it does not scale down the fonts. It looks like the fonts only scale when the resolution of the application changes, which is the expected behavior.
To compensate, when i shrink the window to 75% I also set the native resolution of every font in the game to 33% higher than normal. This causes the text to be the right size.
CEGUI::Font::setNativeResolution(Size(x,y));
This workaround works fine, but its somewhat slow. It takes about 1 second to change ~50 fonts, freezing my application in the meantime.
I could interpolate the change to avoid the freeze but then there would be a "pop in" effect as some fonts would be the wrong size until everything finishes loading.
Is this the only way to get this behavior or is there another work around (besides manually reassigning the fonts which would probably be a nightmare)?
Using CEGUI 7.5
I have a window thats usually 100% of the parent's size and i shrink it down to 75%.
This automatically scales down the images but it does not scale down the fonts. It looks like the fonts only scale when the resolution of the application changes, which is the expected behavior.
To compensate, when i shrink the window to 75% I also set the native resolution of every font in the game to 33% higher than normal. This causes the text to be the right size.
CEGUI::Font::setNativeResolution(Size(x,y));
This workaround works fine, but its somewhat slow. It takes about 1 second to change ~50 fonts, freezing my application in the meantime.
I could interpolate the change to avoid the freeze but then there would be a "pop in" effect as some fonts would be the wrong size until everything finishes loading.
Is this the only way to get this behavior or is there another work around (besides manually reassigning the fonts which would probably be a nightmare)?
Using CEGUI 7.5