void StageSelect::Draw_miniMap_() { glPushMatrix(); { glTranslated(-draw_Map_Size_.x() - 64.0, 0.0, 0.0); if (stage_No_ < stage_Max_No_) { for (size_t y = 0; y < map_Chip_Data_[stage_No_].size(); ++y) { for (size_t x = 0; x < map_Chip_Data_[stage_No_][y].size(); ++x) { float _col = 1.0f * map_Chip_Data_[stage_No_][y][x] / 17.0f; yuFillBox(Vec2f(x * block_Window_Size_[stage_No_].x(), y * block_Window_Size_[stage_No_].y()), block_Window_Size_[stage_No_], false, Color(_col, _col, _col, 1.0f)); } } drawBox(0, 0, draw_Map_Size_.x(), draw_Map_Size_.y(), 2, Color::white); font_.textSize(64); font_.textAlign(YuFont::RIGHT); font_.text("STAGE", Vec2f(draw_Map_Size_.x() - 16.0f - std::to_string(stage_No_ + 1).size() * 64.0f, 16.0f)); font_.text(stage_No_ + 1, Vec2f(draw_Map_Size_.x() - 16.0f, 16.0f)); font_.textSize(32); for (size_t i = 0; i < map_Coment_[stage_No_].size(); ++i) { font_.text(map_Coment_[stage_No_][i], Vec2f(draw_Map_Size_.x(), -32.0f * (i + 1))); } } else { drawBox(0, 0, draw_Map_Size_.x(), draw_Map_Size_.y(), 2, Color::white); font_.textAlign(YuFont::RIGHT); if (stage_No_ == stage_Max_No_ + 0) { font_.textSize(64); font_.text("操作説明", Vec2f(draw_Map_Size_.x() - 16.0f, 16.0f)); font_.textSize(32); font_.text("ゲームの操作方法を", Vec2f(draw_Map_Size_.x(), -32.0f * (1))); font_.text("説明します", Vec2f(draw_Map_Size_.x(), -32.0f * (2))); } if (stage_No_ == stage_Max_No_ + 1) { font_.textSize(64); font_.text("ゲーム終了", Vec2f(draw_Map_Size_.x() - 16.0f, 16.0f)); font_.textSize(32); font_.text("またねー", Vec2f(draw_Map_Size_.x(), -32.0f * (1))); } } } glPopMatrix(); }
void Title::draw() { drawTextureBox(WIDTH / -2, HEIGHT / -2, WIDTH, HEIGHT, 0, 0, 2048, 1395, title_bg); /* yuTextureBox(Vec2f::Zero(), tex_, true); */ font_.textSize(250); font_.textColor(Color::white); yuFillBox(Vec2f(title_Pos_.x() + 0.0f, title_Pos_.y() + 150.0f - 30.0f), Vec2f(2000, 300.0f), true, Color(0.0f, 0.0f, 0.0f, 0.5f)); font_.textAlign(YuFont::CENTER); font_.text("SHIROCHROME", Vec2f(title_Pos_.x(), title_Pos_.y())); font_.textSize(200); if (is_Pushed_) font_Col_.a() = (sin(sYuFrame::Get()() / 2.0f) + 1.0f) / 2.0f; else font_Col_.a() = (sin(sYuFrame::Get()() / 20.0f) + 1.0f) / 2.0f; font_.textColor(font_Col_); yuFillBox(Vec2f(start_Button_Pos_.x() + 0.0f, start_Button_Pos_.y() - -100.0f - 30.0f), Vec2f(800, 200.0f), true, Color(0.0f, 0.0f, 0.0f, 0.5f)); font_.text("START", start_Button_Pos_); if (45 <= frame_) { font_.textSize(32); float _time = float(frame_ - 45.0f) / 60.0f; Vec2f _pos = Vec2f(WIDTH / 2 - 150.0f, EasingExpoOut(_time, -HEIGHT / 2.0f - 300.0f, -HEIGHT / 2.0f + 100.0f)); font_.textColor(Color::white); font_.text("Enterでスタート", _pos); } //fadeに使います。 yuFillBox(Vec2f::Zero(), Vec2f(WIDTH, HEIGHT), true, col_); }
void StageSelect::draw() { Draw_map_Button_(); Draw_miniMap_(); Draw_Side_Menu_(); //fadeに使います。 yuFillBox(Vec2f::Zero(), Vec2f(WIDTH, HEIGHT), true, col_); }
void StageSelect::Draw_Side_Menu_() { int _i = 0; for (auto& obj : menu_) { int _buf_Stage_No = stage_No_; if (obj.hit()) { stage_No_ = _i + stage_Max_No_; if (_buf_Stage_No != stage_No_) { select_Frame_ = 0; select_SE_.play(); } } _i++; } if (stage_No_ == stage_Max_No_ + 0) { menu_[0].hit_ = true; } if (stage_No_ == stage_Max_No_ + 1) { menu_[1].hit_ = true; } for (auto& obj : menu_) { obj.draw(); } menu_[0].drawFont("操作説明"); if (stage_No_ == stage_Max_No_ + 0) { if (env.isPushKey(GLFW_KEY_ENTER)) { is_Menu_ = !is_Menu_; } } menu_[1].drawFont("ゲーム終了"); if (stage_No_ == stage_Max_No_ + 1) { if (env.isPushKey(GLFW_KEY_ENTER)) { is_Exit_ = true; } } if (is_Menu_) { yuFillBox(Vec2f::Zero(), Vec2f(WIDTH, HEIGHT), true, Color(0.0f, 0.0f, 0.0f, 0.9f)); font_.textSize(64); font_.textAlign(YuFont::CENTER); font_.text("ここに、操作説明が貼られます。"); font_.textSize(32); font_.text("Enterで戻る←", Vec2f(WIDTH / 2 - 150.0f, -HEIGHT / 2.0f + 100.0f)); font_.textSize(64); } else { font_.textAlign(YuFont::CENTER); font_.textSize(32); font_.text("Z←→Cで選択", Vec2f(WIDTH / 2 - 150.0f, -HEIGHT / 2.0f + 100.0f)); font_.text("Enterでスタート", Vec2f(WIDTH / 2 - 150.0f, -HEIGHT / 2.0f + 100.0f - 32.0f)); font_.textSize(64); } for (auto& obj : menu_) { obj.size_ = Vec2f(300.0f, 60.0f); } if (stage_No_ < stage_Max_No_) ; else { if (select_Frame_ < 20) { select_Frame_++; } menu_[stage_No_ - stage_Max_No_].size_.x() = EasingExpoOut(select_Frame_ / 20.0f, 300.0f + 100.0f, 300.0f); menu_[stage_No_ - stage_Max_No_].size_.y() = EasingExpoOut(select_Frame_ / 20.0f, 60.0f + 20.0f, 60.0f); } }
void StageSelect::Draw_map_Button_() { font_.textAlign(YuFont::CENTER); glPushMatrix(); { for (size_t z = 0; z < map_Chip_Data_.size(); ++z) { if (z == stage_No_) { ; } else { yuFillBox(Vec2f::Zero(), Vec2f(draw_Select_Box_Size_.x(), draw_Select_Box_Size_.y()), true, Color::white); font_.textColor(color256(40, 88, 207)); font_.text(z + 1, Vec2f(0.0f, -draw_Select_Box_Size_.y() / 4.0f)); drawBox(0, 0, draw_Select_Box_Size_.x(), draw_Select_Box_Size_.y(), 2, Color::black, 0.0f, Vec2f(1.0f, 1.0f), Vec2f(draw_Select_Box_Size_.x() / 2.0f, draw_Select_Box_Size_.y() / 2.0f)); } glTranslated(draw_Select_Box_Size_.x(), 0.0, 0.0); if (z % 5 == 5 - 1) { glPopMatrix(); glPushMatrix(); int _scale = ((z + 1) / 5); glTranslated(0.0, -draw_Select_Box_Size_.y() * _scale, 0.0); } } } glPopMatrix(); glPushMatrix(); { for (size_t z = 0; z < map_Chip_Data_.size(); ++z) { if (z == stage_No_) { Vec2f _size = Vec2f(draw_Select_Box_Size_.x(), draw_Select_Box_Size_.y()); if (select_Frame_ < 20) { select_Frame_++; } _size.x() = EasingExpoOut(select_Frame_ / 20.0f, draw_Select_Box_Size_.x() + 100, draw_Select_Box_Size_.x()); _size.y() = EasingExpoOut(select_Frame_ / 20.0f, draw_Select_Box_Size_.y() + 100, draw_Select_Box_Size_.y()); yuFillBox(Vec2f::Zero(), _size, true, color256(40, 88, 207)); font_.textColor(Color::white); font_.text(z + 1, Vec2f(0.0f, -draw_Select_Box_Size_.y() / 4.0f)); drawBox(0, 0, _size.x(), _size.y(), 2, Color::black, 0.0f, Vec2f(1.0f, 1.0f), Vec2f(_size.x() / 2.0f, _size.y() / 2.0f)); } else { ; } glTranslated(draw_Select_Box_Size_.x(), 0.0, 0.0); if (z % 5 == 5 - 1) { glPopMatrix(); glPushMatrix(); int _scale = ((z + 1) / 5); glTranslated(0.0, -draw_Select_Box_Size_.y() * _scale, 0.0); } } } glPopMatrix(); font_.textColor(Color::white); }