SFML 3 Wie man mit Texten innerhalb eines Rechtecks umgeht
Posted: 12 Apr 2025, 17:05
Code: Select all
#pragma once
#include
class RectangleWText
{
private:
sf::RectangleShape shape;
sf::Font font;
sf::Text label(std::string&);
public:
RectangleWText(const sf::Vector2f& size, const sf::Vector2f& position, const
std::string& text = "", const std::string& fontPath = "fonts/verdana.ttf") {
if (!font.openFromFile("verdana.ttf"))
{
std::cerr