Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - andrewkoro105

Pages: [1]
1
Graphics / custom text, the kerning is always zero
« on: January 21, 2023, 01:42:07 pm »
I write my own implementation of the text and it always returns 0 when I request a kerning.The query in line 118 of https://github.com/Hedgehogo/Interface_Engine/blob/master/lib/ui/iObject/iUnscalable/interactive/text/character/simple/character.cpp this is a letter class, it has a getKerning function in which passes the following letter

2
General / How to get the real displacement of the mouse wheel
« on: September 04, 2022, 01:32:56 pm »
How to get the real displacement of the mouse wheel (which means fractional delta value).

3
Window / RenderTarget slow
« on: June 27, 2022, 10:33:42 am »
When I changed the reference from RenderWindow to RenderTarget, the render function slowed down by half. Is this a problem in SFML or in our program?

4
Graphics / Re: custom text
« on: June 14, 2022, 11:35:45 am »
I need to find bearing


5
Graphics / custom text
« on: June 14, 2022, 11:10:56 am »
I'm trying to create custom text and I can't get origin or bearing for the character.



#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::Sprite sprite, sprite1;


    sf::Font font;
    font.loadFromFile("segoeui.ttf");
    sf::Glyph glyph0 = font.getGlyph('a', 20, false);
    sf::Glyph glyph1 = font.getGlyph('F', 20, false);

    sprite.setTexture(font.getTexture(20));
    sprite.setTextureRect(glyph0.textureRect);
    sprite.setPosition(0, 20);

    sprite1.setTexture(font.getTexture(20));
    sprite1.setTextureRect(glyph1.textureRect);
    sprite1.setPosition(glyph1.advance, 20);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(sprite);
        window.draw(sprite1);
        window.display();
    }

    return 0;
}

Pages: [1]
anything