# include <Siv3D.hpp> // OpenSiv3D v0.6.10 # include <vector> void Main() { // 背景の色を設定する | Set the background color Scene::SetBackground(ColorF{ 0.6, 0.8, 0.7 }); // 絵文字からテクスチャを作成する | Create a texture from an emoji const Texture emoji{ U"🦖"_emoji }; // 太文字のフォントを作成する | Create a bold font with MSDF method const Font font{ FontMethod::MSDF, 48, Typeface::Bold }; // テキストに含まれる絵文字のためのフォントを作成し、font に追加する | Create a font for emojis in text and add it to font as a fallback const Font emojiFont{ 48, Typeface::ColorEmoji }; font.addFallback(emojiFont); Vec2 clicPoint[2] = { {0,0},{0,0} }; int state = 0;//0:1個目クリック 1:2個目クリック 2:ベクトル表示 Line lines[6]; //5本引いてから、最初の点から最後の点にベクトル引くから6本! while (System::Update()) { if (MouseL.down()) { switch (state) { case 0: case 1: clicPoint[state] = Cursor::PosF(); state++; break; case 2: state = 0; break; default: Print << U"エラー"; } Print << state; } if (state == 1) Circle{ clicPoint[0], 4 }.draw(Palette::Black); if(state == 2) Line{ clicPoint[0],clicPoint[1] }.draw(4, Palette::Orange); } }