Closed Reputeless closed 1 month ago
# include <Siv3D.hpp>
void Main()
{
Scene::SetBackground(ColorF{ 0.6, 0.8, 0.7 });
const Font font{ FontMethod::MSDF, 48, Typeface::Bold };
const String text = U"The quick brown fox jumps over the lazy dog.";
while (System::Update())
{
const Rect rect = Rect::FromPoints(Point{ 50, 20 }, Cursor::Pos());
rect.draw();
if (not font(text).draw(60, rect.stretched(-10), ColorF{ 0.11, 0.1 }))
{
rect.drawFrame(0, 5, ColorF{ 0.11 });
}
if (not font(text).fits(60, rect.stretched(-10)))
{
rect.drawFrame(5, 0, ColorF{ 0.5 });
}
}
}