void Main() { Window::SetTitle(L"THUNDER #Siv3DGameJam"); // 普段の描画先:最後にSCALE倍する RenderTexture render_texture{ SCREEN_SIZE, Palette::Black }; initGraphics(); FontAsset::Register(L"title", 14, L"Times New Roman", FontStyle::BitmapBoldItalic); FontAsset::Register(L"sys", 6, L"Arial", FontStyle::BitmapBold); FontAsset::Register(L"over", 10, L"Verdana", FontStyle::BitmapBold); FontAsset::Register(L"wave", 8, L"Arial Black", FontStyle::Bitmap); FontAsset::Register(L"clear", 8, L"Verdana", FontStyle::BitmapBold); TextureAsset::Register(L"a", L"Asset/a.png"); gSceneMgr.add(new SceneTitle()); while (System::Update()) { #ifdef _DEBUG // デバッグ表示 ClearPrint(); PutText(Profiler::FPS()).at(10, 440); #endif // _DEBUG // シーンを更新 gSceneMgr.update(); // シーンがなくなったらプログラム終了 if (gSceneMgr.empty()) { break; } // シーンを描画 Graphics2D::SetRenderTarget(render_texture); gSceneMgr.draw(); // 拡大表示 Graphics2D::SetRenderTarget(Graphics::GetSwapChainTexture()); render_texture.scale(SCALE).draw(); gSceneMgr.postUpdate(); } }
void Main() { TextureAsset::Register(U"sample", U"asc_anime_sample.png"); Texture texture(U"asc_anime_sample.png"); asc::Anime anime(texture, 4, 0.1s); asc::AnimeAsset animeAsset(U"sample", { 0.1s, 0.5s, 0.1s, 0.1s }); bool stop = false; bool slow = false; while (System::Update()) { if (MouseL.down()) { stop = !stop; } if (MouseR.down()) { slow = !slow; } ClearPrint(); Print(U"[MouseL] stop : {}"_fmt(stop)); Print(U"[MouseR] slow : {}"_fmt(slow)); if (!stop) { anime.update(System::DeltaTime()); } animeAsset.update((slow ? 0.2 : 1.0) * System::DeltaTime()); anime.mirrored().draw(Arg::topLeft = Point(50, 70)); animeAsset.draw(Arg::center = Cursor::Pos()); } }
main( INT_T argc, char * argv[] ) { INT_T i; mapD.size.x = 4*12; mapD.size.y = 3*12; printD.scale = 1.0; for (i=0; i<(sizeof cmds)/(sizeof cmds[0]); i++) { switch (cmds[i].cmd) { case C_START: CmdPrint( cmds[i].cmd ); DumpMap( "Start\n", 0, 0 ); break; case C_DOWN: CmdPrint( cmds[i].cmd, cmds[i].pos ); DumpMap( "Down (%0.3f %0.3f)\n", cmds[i].pos.x, cmds[i].pos.y ); break; case C_MOVE: CmdPrint( cmds[i].cmd, cmds[i].pos ); DumpMap( "Move (%0.3f %0.3f)\n", cmds[i].pos.x, cmds[i].pos.y ); break; case C_UP: CmdPrint( cmds[i].cmd, cmds[i].pos ); DumpMap( "Up\n", 0, 0 ); break; case C_PRINT: DoPrintPrint( NULL ); DumpMap( "Print\n", 0, 0 ); break; case C_CANCEL: ClearPrint(); DumpMap( "Cancel\n", 0, 0 ); break; case C_SCALE: printD.scale = cmds[i].x; break; } } }