Siv3D/OpenSiv3D

Timer の残り時間(秒)を切り上げて取得する Timer::s_ceil()

Closed this issue · 1 comments

# include <Siv3D.hpp>

void Main()
{
	Scene::SetBackground(ColorF{ 0.6, 0.8, 0.7 });
	const Font font{ FontMethod::MSDF, 40, Typeface::Bold };
	Timer timer{ 10s };

	while (System::Update())
	{
		if (SimpleGUI::Button(U"Start", Vec2{ 500, 60 }))
		{
			timer.start();
		}

		font(U"{}"_fmt(timer.format())).draw(60, Vec2{ 40, 40 }, ColorF{ 0.4 });
		font(U".s():		{}"_fmt(timer.s())).draw(60, Vec2{ 40, 140 }, ColorF{ 0.11 });
		font(U".s_ceil():	{}"_fmt(timer.s_ceil())).draw(60, Vec2{ 40, 240 }, ColorF{ 0.11 });
	}
}