Hi,
I am trying to display text using SFML 2.0.
Text is displayed very nice at first, but while resizing i recreate the text object and use this code for scaling:
sf::Text crd; // Create text object..
crd.setFont(My_Fonts::types[0]); // Select font..
crd.setString("Sample Text"); // Set string..
crd.setOrigin(0, 0);
crd.setPosition(10* 1000 / width, 400); // Set position using width variable so it remains at the same point after resizing.. I couldn't find a way to make y point remain unchanged, (400 * 1000/height) doesn't work..
// Variable 1000 is an experimental value i use to specify the gap between text and window border..
crd.setCharacterSize(12U);
crd.setColor(sf::Color(0,0,0));
crd.scale(height/width, 1.0f); // Set scale x according to y and leave y untouched..
texts.push_back(crd); // Put it into an array..
With this code i can save x scale but the y scale is deformed and after resizing the text is displayed stretched.
I hope i could explain my problem. Thanks in advance:)