Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rect::chamfered() #1268

Open
Reputeless opened this issue Oct 2, 2024 · 0 comments
Open

Rect::chamfered() #1268

Reputeless opened this issue Oct 2, 2024 · 0 comments
Labels

Comments

@Reputeless
Copy link
Member

Reputeless commented Oct 2, 2024

# include <Siv3D.hpp>

void Main()
{
	Scene::SetBackground(ColorF{ 0.6, 0.8, 0.7 });
	const Font font{ FontMethod::MSDF, 48, Typeface::Bold };

	const Rect button1{ 100, 100, 320, 100 };
	const Rect button2{ 100, 300, 320, 100 };

	double s = 0.0;
	double tl = 50.0;
	double tr = 50.0;
	double bl = 50.0;
	double br = 50.0;

	while (System::Update())
	{
		button1.chamfered(s).draw(ColorF{ 0.3, 0.6, 0.9 });
		font(U"アイテム").drawAt(44, button1.center(), ColorF{ 1.0 });

		button2.chamfered(tl, tr, bl, br).draw(ColorF{ 0.3, 0.6, 0.9 });
		font(U"アイテム").drawAt(44, button2.center(), ColorF{ 1.0 });

		SimpleGUI::Slider(s, 0.0, 100.0, Vec2{ 500, 100 }, 180);
		SimpleGUI::Slider(tl, 0.0, 100.0, Vec2{ 500, 300 }, 180);
		SimpleGUI::Slider(tr, 0.0, 100.0, Vec2{ 500, 340 }, 180);
		SimpleGUI::Slider(bl, 0.0, 100.0, Vec2{ 500, 380 }, 180);
		SimpleGUI::Slider(br, 0.0, 100.0, Vec2{ 500, 420 }, 180);
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

1 participant