-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.cpp
32 lines (23 loc) · 881 Bytes
/
Main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Scene/Viewport(Iframe) Units
// https://scrapbox.io/Siv3D-instances/Scene%2FViewport(Iframe)_Units
#include <Siv3D.hpp> // OpenSiv3D v0.6.11
import tomolatoon.iframe.units;
void Main() {
using namespace tomolatoon::units;
Window::Resize(1'000, 1'000, Centering::Yes);
Window::SetStyle(WindowStyle::Sizable);
// Scene::SetResizeMode(ResizeMode::Actual);
Scene::SetBackground(Color(U"#B8C9CD"));
while (System::Update())
{
// _vw/_vh は、Viewport(Iframe) が設定されていない場合は _sw/_sh と同じ値を返す
// top left
RectF({5_vw, 5_vh}, {42.5_vw, 42.5_vh}).draw(Palette::Red);
// top right
RectF({52.5_vw, 5_vh}, {42.5_vw, 42.5_vh}).draw(Palette::Green);
// bottom right
RectF({52.5_vw, 52.5_vh}, {42.5_vw, 42.5_vh}).draw(Palette::Yellow);
// bottom left
RectF({5_vw, 52.5_vh}, {42.5_vw, 42.5_vh}).draw(Palette::Blue);
}
}