void graph_title(){ graph_back(); DrawStringToHandle(140,120,"弾幕段位認定",color[0],font[3]); DrawStringToHandle(270,240,"START",color[0],font[1]); DrawStringToHandle(220,290,"KEY CONFIG",color[0],font[1]); DrawStringToHandle(260,340,"MANUAL",color[0],font[1]); DrawStringToHandle(280,390,"QUIT",color[0],font[1]); DrawStringToHandle(175,240+(menu_state*50),"→",color[0],font[1]); switch(menu_state){ case 0: DrawStringToHandle(255,450,"ゲームを開始します",color[0],font[2]); break; case 1: DrawStringToHandle(190,450,"パッドの各種ボタン設定を変更します",color[0],font[2]); break; case 2: DrawStringToHandle(165,450,"ゲームのルールや操作方法などを表示します",color[0],font[2]); break; case 3: DrawStringToHandle(255,450,"ゲームを終了します",color[0],font[2]); break; } }
// ボタンの描画 void BaseButton::Draw() { // 描画をαブレンドに設定 SetDrawBlendMode(DX_BLENDMODE_ALPHA, 128); // マウスカーソルがボタンの上にあるか if (IsMouseOver) { DrawBox(APosition_LT.x, APosition_LT.y, APosition_LT.x + Size.x, APosition_LT.y + Size.y, 0xFFFFFF - ButtonStringColor, TRUE); } // 描画をノーブレンドに戻す SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0); // ボタンの状態によって描画する画像を変える switch (ButtonState) { case CLICK_PRESS: case CLICK_PRESSED: DrawBox(APosition_LT.x, APosition_LT.y, APosition_LT.x + Size.x, APosition_LT.y + Size.y, 0xFFFFFF - ButtonStringColor, FALSE); DrawStringToHandle(APosition_LT.x + (Size.x - GetDrawFormatStringWidthToHandle(FontHandle, ShowString.c_str())) / 2, APosition_LT.y + (Size.y - GetDrawStringWidthToHandle(_T("あ"), 1, FontHandle)) / 2, ShowString.c_str(), 0xFFFFFF - ButtonStringColor, FontHandle); break; case CLICK_DEFAULT: case CLICK_RELEASE: default: DrawBox(APosition_LT.x, APosition_LT.y, APosition_LT.x + Size.x, APosition_LT.y + Size.y, ButtonStringColor, FALSE); DrawStringToHandle(APosition_LT.x + (Size.x - GetDrawFormatStringWidthToHandle(FontHandle, ShowString.c_str())) / 2, APosition_LT.y + (Size.y - GetDrawStringWidthToHandle(_T("あ"), 1, FontHandle)) / 2, ShowString.c_str(), ButtonStringColor, FontHandle); break; } BaseGUIObj::Draw(); }
void graph_difficult(){ graph_back(); DrawStringToHandle(140,120,"弾幕段位認定",color[0],font[3]); DrawStringToHandle(280,250,"EASY",color[0],font[1]); DrawStringToHandle(260,290,"NORMAL",color[3],font[1]); DrawStringToHandle(280,330,"HARD",color[2],font[1]); DrawStringToHandle(250,370,"LUNATIC",color[7],font[1]); DrawStringToHandle(210,250+(menu_state*40),"→",color[0],font[1]); switch(menu_state){ case 0: DrawStringToHandle(90,450,"眼に優しい難易度です。STGが苦手・やったことない人はこちら。",color[0],font[2]); break; case 1: DrawStringToHandle(75,450,"比較的易しい難易度です。ノーマルシューターならなんとかなるはず。",color[0],font[2]); break; case 2: DrawStringToHandle(100,450,"そこそこ難しい難易度です。回数をこなせばなんとかなるはず。",color[0],font[2]); break; case 3: DrawStringToHandle(50,450,"本気な難易度です。バリバリのシューターさんは高ランクを狙いましょう。",color[0],font[2]); break; } }
void FontManager::DrawFontStringNumSet(FontSet font, int pX, int pY, char *string, int pWidth, int charNum, int color) { if( m_FontData[font].handle == 0) { Load(font); } char buffer[256]; int allCount = 0; // 全体の文字数 int count = 0; // 現在保存中の文字数 int length = 0; // 文字列の横ピクセル int charNumCount = 0; // 文字数カウント // 終端文字までループ while(string[allCount] != '\0') { if(charNumCount > charNum-1){ buffer[count] = '\0'; DrawStringToHandle(pX, pY, buffer, color, m_FontData[font].handle); break; } char c = string[allCount]; // 2バイト文字なら //if((c >= 0x81 && c <= 0x9F) || (c >= 0xE0 && c <= 0xFC)) if( _mbclen((BYTE*)&string[allCount]) == 2) { // 指定した横幅を超えたら描画 if(length + m_FontData[font].stringWidth >= pWidth) { buffer[count] = '\0'; DrawStringToHandle(pX, pY, buffer, color, m_FontData[font].handle); pY += m_FontData[font].size; length = 0; count = 0; } buffer[count] = c; buffer[count + 1] = string[allCount + 1]; allCount += 2; count += 2; length += m_FontData[font].stringWidth; } else { if(length + m_FontData[font].halfStringWidth >= pWidth) { buffer[count] = '\0'; DrawStringToHandle(pX, pY, buffer, color, m_FontData[font].handle); pY += m_FontData[font].size; length = 0; count = 0; } buffer[count] = c; allCount++; count++; length += m_FontData[font].halfStringWidth; } charNumCount++; } buffer[count] = '\0'; DrawStringToHandle(pX, pY, buffer, color, m_FontData[font].handle); }
//スペル文字表示パターンの描画 void graph_spell(){ if(count == 180 || count == 2160 || count == 4140 || count == 6120 || count == 8100 || count == 10080 || count == 12060 || count == 14040 || count == 16020 || count == 18000){ spcount=0; se_flag[5]=1; } if(count >= 180 && count < 1980){ graph_cut("Spell1「低速ばらまき弾」",215); } if(count >= 2160 && count < 3960){ if(stage<=1) graph_cut("Spell2「二段速落下弾」",195); else graph_cut("Spell2「三段速落下弾」",195); } if(count >= 4140 && count < 5940){ graph_cut("Spell3「交差弾」",140); } if(count >= 6120 && count < 7920){ graph_cut("Spell4「高速ばらまき弾」",215); } if(count >= 8100 && count < 9900){ graph_cut("Spell5「回転ワインダー」",215); } if(count >= 10080 && count < 11880){ graph_cut("Spell6「自機狙い複合弾」",215); } if(count >= 12060 && count < 13860){ if(stage<=3) graph_cut("Spell7「詐欺判定弾」",175); else graph_cut("Spell7「大弾物量殺し」",195); } if(count >= 14040 && count < 15840){ graph_cut("Spell8「左右ワインダー」",215); } if(count >= 16020 && count < 17820){ if(stage<=1) graph_cut("Spell9「左右&上下拘束弾」",235); else graph_cut("Spell9「低速移動禁止&拘束弾」",275); } if(count >= 18000 && count < 19800){ graph_cut("spell10「波紋疾走」",175); } if(count>=30 && count<180){ DrawStringToHandle(135,185,"迫る弾幕を",color[0],font[1]); DrawStringToHandle(120,225,"避け続けろ!",color[0],font[1]); } if(spcount>=1800 && sg_flag==1) DrawStringToHandle(55,185,"Get Spell Bonus!!",color[0],font[1]); }
//スペル文字・残り時間の描画 void graph_cut(char *string,int length){//スペル名、下線部の長さ int t = spcount; if(t >= 0 && t < 100){ DrawStringToHandle(100,215,string,color[0],font[0]); DrawLine(100,232,100+length,232,color[2]); } else{ DrawStringToHandle(FX,FY,string,color[0],font[0]); DrawLine(FX,FY+17,FX+length,FY+17,color[2]); } DrawFormatStringToHandle(395,FY,color[0],font[0],"%d",(1860-spcount)/60); }
void Window_Selectable::DrawContent() const{ TCHAR buf[WND_SELECTABLE_TITLELENGTH]; BYTE color; int contentSize = 0; BYTE _state = state; if(GetActive()){ if(drawFocus){ DrawFocus(); } int cntX = frameArea.x + contentArea.x; int cntY = frameArea.y + contentArea.y; // タイトルを描画する場合 if(useTitle){ GetTitle(buf); DrawStringToHandle( cntX + GetDrawDeltaX(buf, -1, titleFontSize.hFont), cntY, buf, GetPresetColor(presetColorIndex, COLORSET_COLOR_NORMAL), titleFontSize.hFont); cntY += titleFontSize.lineHeight; } // 各選択肢の描画 contentSize = num; for(int n=0; n<contentSize; n++){ color = select.isActive[n] ? ((select.index == n) ? WND_SELECTABLE_COLOR_SELECTED : WND_SELECTABLE_COLOR_ACTIVE) : WND_SELECTABLE_COLOR_INACTIVE, DrawContentItem(n, color); } } SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255); }
void Window::DrawStringInWindow(int Input_x,int Input_y,int Input_Pos,string Input_String,int FontData,int Color) { vector<string> Strs = split(Input_String,"<>"); int Height; GetFontStateToHandle(NULL,&Height,NULL,FontData); Height *= 1.4; int Length = Strs.size(); int Draw_y = Input_y-Height; for(int i=0;i<Length;i++) { int Graph; int Draw_x = Input_x; Draw_y += Height; int DrawWidth = GetDrawStringWidthToHandle(Strs[i].c_str(),Strs[i].size(),FontData); int Size; float Ext = 1.0f; if(Input_Pos == DrawString_Center)Draw_x -= DrawWidth/2; else if(Input_Pos == DrawString_Right)Draw_x -= DrawWidth; GetFontStateToHandle(0,&Size,0,FontData); Graph = MakeScreen(DrawWidth,Size*2,true); SetDrawScreen(Graph); DrawStringToHandle(0,0,Strs[i].c_str(),Color,FontData); if(DrawWidth + Draw_x >= Width) { Ext = (float)Width / (float)(DrawWidth + Draw_x) - 0.01f; } SetDrawScreen(Screen); DrawRotaGraph2(Draw_x,Draw_y,0,0,Ext,0.f,Graph,true); DeleteGraph(Graph); } SetDrawScreen(DX_SCREEN_BACK); }
void Window_Selectable::DrawContentItem(int index, BYTE fontColor) const{ TCHAR buf[WND_SELECTABLE_TITLELENGTH]; WINDOWAREA tmpArea; int ddx=0; // 中央揃え・右揃えの時の描画位置のずれ tmpArea = GetDrawArea(index); GetContent(buf, index); switch(windowFont.align){ case 0: ddx = 0; break; case 1: ddx = (tmpArea.w - GetStrWidth(buf, strlen(buf), windowFont.hFont))/2; break; case 2: ddx = tmpArea.w - GetStrWidth(buf, strlen(buf), windowFont.hFont); break; } int color = fontColor; switch(color){ case WND_SELECTABLE_COLOR_SELECTED: color = windowFont.color; break; case WND_SELECTABLE_COLOR_ACTIVE: color = windowFont.iColor; break; case WND_SELECTABLE_COLOR_INACTIVE: color = windowFont.nColor; break; } DrawStringToHandle( tmpArea.x+ddx, tmpArea.y, buf, color, windowFont.hFont); }
void Game_UseSkillManager::DrawCntSkillAccount( int _x, int _y, int _color) const{ TCHAR buf[128]; d_skillInfo.GetSkillAccount(buf, GetCntSkillID()); DrawStringToHandle(_x, _y, buf, _color, g_font.hStrS); }
//ゲームオーバーの描画 void draw_GameOver() { int FontHandle = CreateFontToHandle("HGS創英角ポップ体", 64, 8, DX_FONTTYPE_ANTIALIASING_EDGE); char *str = "Game Over...."; int Strlen = strlen(str); int Width = GetDrawStringWidthToHandle(str, Strlen, FontHandle); DrawStringToHandle(320 - Width / 2, 208, str, GetColor(255, 255, 255), FontHandle); /*フェードイン、フェードアウト*/ SetDrawBlendMode(DX_BLENDMODE_ALPHA, charClearOver); str = "スペースキーを押せば、もう一度プレイできます"; Strlen = strlen(str); Width = GetDrawStringWidth(str, Strlen); DrawString(320 - Width / 2, 280, str, GetColor(255, 255, 255)); //ブレンドを元に戻す SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0); if (charClearOver > 255 || charClearOver < 0) { i *= -1; } charClearOver += i; //フォントを削除 DeleteFontToHandle(FontHandle); }
void Game_DollUniteManager::DrawPreviewSkillList(int _x, int _y, int _alpha) const{ int _posX=0, _posY=0; SetDrawBlendMode(DX_BLENDMODE_ALPHA, _alpha); // 見出しの描画 DrawBox( _x, _y, _x + (SKILLUNITELIST_PREVIEW_WIDTH*2)-1, _y + FONTSIZE_INFO+4-1, GetColor(64,64,64), 1); TCHAR buf[32]; wsprintf(buf, _T("拡張スキル候補(%d個選択)"), 2+skillPlusNum); DrawStringToHandle( _x+42, _y+2, buf, GetColor(255,255,255), g_font.hInfo); SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255); for(int n=0; n<DOLLUNITEMANAGER_SKILLUNITE_NUM; n++){ _posX = n%2; _posY = n/2; DrawPreviewSkillListCell( _x + SKILLUNITELIST_PREVIEW_WIDTH * _posX, _y + (FONTSIZE_INFO+4) + SKILLUNITELIST_PREVIEW_HEIGHT * _posY, n, _alpha); } }
void FontManager::DrawCenter(FontSet font, int x, int y, char *string, int color) { // fontをまだ作っていなかった場合ロードする if( m_FontData[font].handle == 0) { Load(font); } char buffer[256]; int count = 0; // 現在保存中の文字数 int length = 0; // 文字列の横ピクセル // 終端文字までループ while(string[count] != '\0') { char c = string[count]; // 2バイト文字なら //if((c >= 0x81 && c <= 0x9F) || (c >= 0xE0 && c <= 0xFC)) if( _mbclen((BYTE*)&string[count]) == 2) { buffer[count] = c; buffer[count + 1] = string[count + 1]; count += 2; length += m_FontData[font].stringWidth; } else { buffer[count] = c; count++; length += m_FontData[font].halfStringWidth; } } buffer[count] = '\0'; DrawStringToHandle(x - length / 2, y, buffer, color, m_FontData[font].handle); }
void Scene_Title::Draw() const{ TCHAR menuString[MAX_TITLE_MENU][64] = { _T("はじめから"), _T("つづきから"), _T("記憶の中の人形"), _T("トロフィー"), _T("戦闘チュートリアルへ"), _T("オプション"), _T("ゲームを終了")}; TCHAR chapterString[MAX_CHAPTER][64] = { _T("妖精の夢(仮)"), _T("幽霊の夢(仮)"), _T("死者の夢(仮)"), _T("少女の夢(仮)"), _T("アリスの夢(仮)"), _T("テストプレイ用") }; // 各メニューを描画する for(int n=0; n<MAX_TITLE_MENU; n++){ DrawStringToHandle(200, 300+34*n, menuString[n], (n == s_main.index ? GetColor(255, 255, 255) : GetColor(96, 96, 96)), g_font.hInfo, 0, 0); } // シーン切り替えのフェードの描画 DrawReserveFade(); }
//タイトルの描画 void draw_Title() { int FontHandle = CreateFontToHandle("HGS創英角ポップ体", 64, 8, DX_FONTTYPE_ANTIALIASING_EDGE); char *str = "Space Shooting"; int Strlen = strlen(str); int Width = GetDrawStringWidthToHandle(str, Strlen, FontHandle); DrawStringToHandle(320 - Width / 2, 208, str, GetColor(255, 255, 255), FontHandle); /*フェードイン、フェードアウト*/ SetDrawBlendMode(DX_BLENDMODE_ALPHA, char_br); str = "スペースキーを押してください"; Strlen = strlen(str); Width = GetDrawStringWidth(str, Strlen); DrawString(320 - Width / 2, 280, str, GetColor(255, 255, 255)); //ブレンドを元に戻す SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0); if (char_br > 255 || char_br < 0) { i *= -1; } char_br += i; //フォントを削除 DeleteFontToHandle(FontHandle); }
int menu::Drow_menus() { count(); for(unsigned int i=0; i<menus.size(); ++i) { if(i==select_m) DrawStringToHandle(std::get<0>(menus[i])-35,std::get<1>(menus[i]), std::get<2>(menus[i]).c_str(),menu_string_color,font_Handle[0]); else DrawStringToHandle(std::get<0>(menus[i]),std::get<1>(menus[i]), std::get<2>(menus[i]).c_str(),menu_string_color,font_Handle[0]); } if(CheckHitKey(KEY_INPUT_RETURN)) return select_m; return -1; }
void Title::Draw() { DrawStringToHandle(WINDOW_WIDTH * 3 / 4, WINDOW_HEIGHT * 6 / 10, "New Game", 0xFFFFFF, (*(*dataBase)->font)(18), 0xDDDDDD); if (PathFileExists("savedata.sav")) DrawStringToHandle(WINDOW_WIDTH * 3 / 4, WINDOW_HEIGHT * 7 / 10, "Load Game", 0xFFFFFF, (*(*dataBase)->font)(18), 0xDDDDDD); DrawStringToHandle(WINDOW_WIDTH * 3 / 4, WINDOW_HEIGHT * 8 / 10, "Exit", 0xFFFFFF, (*(*dataBase)->font)(18), 0xDDDDDD); switch (Selecting){ case TIT_START: SetDrawBlendMode(DX_BLENDMODE_MUL, 255); DrawStringToHandle(WINDOW_WIDTH * 3 / 4, WINDOW_HEIGHT * 6 / 10, "New Game", 0xFFFFFF, (*(*dataBase)->font)(18), 0x00FFFF); break; case TIT_LOAD: SetDrawBlendMode(DX_BLENDMODE_MUL, 255); DrawStringToHandle(WINDOW_WIDTH * 3 / 4, WINDOW_HEIGHT * 7 / 10, "Load Game", 0xFFFFFF, (*(*dataBase)->font)(18), 0x00FFFF); break; case TIT_EXIT: SetDrawBlendMode(DX_BLENDMODE_MUL, 255); DrawStringToHandle(WINDOW_WIDTH * 3 / 4, WINDOW_HEIGHT * 8 / 10, "Exit", 0xFFFFFF, (*(*dataBase)->font)(18), 0x00FFFF); break; } SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255); DrawStringToHandle(0, WINDOW_HEIGHT - 20, "Z:決定 十字キー:選択", 0xFFFFFF, (*(*dataBase)->font)(15), 0xFFFFFF); if (ChangeCounter) BlackOut(); }
//文字列を描画 void DrawableText::draw(){ assert("setFontHandleが呼ばれていない,またはハンドル取得に失敗しています" && m_fontHandle >= 0); if (m_textColor < 0){ return; } /*文字列を表示する*/ if (this->getIsVisible() == true) { DrawStringToHandle(getX(), getY(), m_text.c_str(), m_textColor, m_fontHandle); } else{} }
void DrawString_Title(int x, int y, char * String, unsigned int Color, int mode) { switch (mode) { case 1: DrawStringToHandle(x, y, String, Color, Font_h); //大きく書く break; default: DrawString(x, y, String, Color); break; } }
main_status end(const img_arr_t&, const sound_arr_t& sound, const config_info::lang_table_t& lang_table) { for (auto& s : sound) s.second.stop();//BGM全部停止 //フォントの定義 static const int font_title = CreateFontToHandle(nullptr, 100, 5, DX_FONTTYPE_EDGE);//タイトルロゴ static const int font_1 = CreateFontToHandle(nullptr, 30, 1, DX_FONTTYPE_ANTIALIASING);//「Xキーを押してね」の奴 keystate state; auto normal_con_f = []() -> bool { bool re = -1 != ProcessMessage() && 0 == ScreenFlip() && 0 == ClearDrawScreen(); if (!re) throw std::runtime_error("ProcessMessage() return -1."); return re; }; bool is_normal_state = normal_con_f(); DrawBox(0, 0, WINDOW.width, WINDOW.height, GetColor(200, 200, 100), TRUE); //背景 DrawStringToHandle(WINDOW.width * 37 / 320, WINDOW.height / 4, (L"- " + lang_table.at(L"I did it!") + L" -").c_str(), GetColor(250, 0, 0), font_title); DrawStringToHandle(WINDOW.width * 13 / 40, WINDOW.height / 4 + 250, (L"- " + lang_table.at(L"Press X") + L" -").c_str(), GetColor(0, 0, 0), font_1); is_normal_state = normal_con_f(); while ((is_normal_state = -1 != ProcessMessage()) && state.update() && !state[KEY_INPUT_X] && !state.esc()) { std::this_thread::sleep_for(std::chrono::milliseconds(50)); } if (!is_normal_state) throw std::runtime_error("ProcessMessage() return -1."); if (state.esc()) throw normal_exit(); return main_status::title; }
void Setting(menu& m) { unsigned int Green=GetColor(255,255,255); int max_f=-1; m.effectiving(); DrawStringToHandle(0,145,"測定回数設定:",Green,m.font_Handle[2]); max_f=KeyInputNumber(0,200,640,0,false); std::ofstream ofs("data/max_v.dat"); if(!ofs.is_open())assert(0); ofs<<max_f; ofs.close(); }
void text(int *flag){ static int font; if (*flag == 0){ font = CreateFontToHandle(NULL, 64, 5, DX_FONTTYPE_NORMAL); *flag = 1; } ChangeFont("MS 明朝"); SetMainWindowText("タイトル"); DrawFormatString(20, 430, 0xffffff, "2キーで2人プレイ、3キーで3人プレイ、4キーで4人プレイ、"); DrawFormatString(20, 450, 0xffffff, "Cキーでギャラリー画面へ"); DrawStringToHandle(150, 240 - 42, "神 経 衰 弱", GetColor(255, 100, 50), font); }
void Game_DecoratedText::Draw(int _x, int _y, int _n, int _w, BYTE _align) const{ int color = 0x00ffffff; int tmpX = _x; // 現在の描画位置 // _align値に応じて描画位置を判断する int width = GetDrawWidth(); switch(_align){ case ALIGN_CENTER: tmpX += (_w-width)/2; break; case ALIGN_RIGHT: tmpX += (_w-width); break; } int count = 0; if(_n==-1){ count = GetStrLen(); }else{ count = _n; } for(int n=0; n<min(DECORATEDTEXT_MAX_LENGTH, count); n++){ // 使われていない文字に出会ったらすぐに終了する if(!drawBuf[n].used) return; // フラグから文字色を判断する。 if(drawBuf[n].flags & DECORATEDTEXT_FLAG_ACTIVE){ color = GetPresetColor(presetColor, COLORSET_COLOR_ACTIVE); }else if(drawBuf[n].flags & DECORATEDTEXT_FLAG_POSITIVE){ color = GetPresetColor(presetColor, COLORSET_COLOR_POSITIVE); }else if(drawBuf[n].flags & DECORATEDTEXT_FLAG_POSITIVE){ color = GetPresetColor(presetColor, COLORSET_COLOR_NEGATIVE); }else{ color = GetPresetColor(presetColor, COLORSET_COLOR_NORMAL); } // 文字を描画する DrawStringToHandle(tmpX, _y, drawBuf[n].character, color, hFont); // 描画位置を送る if(drawBuf[n].flags & DECORATEDTEXT_FLAG_HALF){ tmpX += halfCharWidth; }else{ tmpX += charWidth; } } }
void graph_pause(){ graph_board();//ボードの描画 graph_board_states();//ボード情報の描画 draw_fps(620,465);//fps描画 DrawStringToHandle(170,120,"PAUSE",color[0],font[1]); //リプレイ再生中は表示名を変更 if(replay_flag == 1){ DrawStringToHandle(170,240,"再生を続ける",color[0],font[0]); DrawStringToHandle(160,280,"タイトルに戻る",color[0],font[0]); DrawStringToHandle(170,320,"最初から再生",color[0],font[0]); }else{ DrawStringToHandle(160,240,"ゲームを続ける",color[0],font[0]); DrawStringToHandle(160,280,"タイトルに戻る",color[0],font[0]); DrawStringToHandle(160,320,"最初から始める",color[0],font[0]); } DrawStringToHandle(140,240+(menu_state*40),"→",color[0],font[0]); }
void begin(menu& m) { ClearDrawScreen(); const unsigned int x=0; const unsigned int y=195; const unsigned int Green=GetColor(0,255,0); unsigned int counter=0; m.load_max_v(); DrawFormatString(520,450,GetColor(255,255,255),"Loading ..."); for(unsigned int count_down=3; !ScreenFlip()&&!ProcessMessage()&&!ClearDrawScreen()&&count_down>0; --count_down){ m.effectiving(); DrawStringToHandle(x+260,y,boost::lexical_cast<std::string>(count_down).c_str(), Green,m.font_Handle[1]); std::this_thread::sleep_for(std::chrono::seconds(1)); } std::this_thread::sleep_for(std::chrono::seconds(1)); std::chrono::system_clock::time_point start=std::chrono::system_clock::now(); while(!ScreenFlip()&&!ProcessMessage()&&!ClearDrawScreen()){ m.effectiving(); DrawStringToHandle(x+100,y,"残り",Green,m.font_Handle[0]); DrawStringToHandle(x+235,y,boost::lexical_cast<std::string>(m.max_v-counter).c_str(), Green,m.font_Handle[1]); DrawStringToHandle(x,0, (std::string("回数: ")+=boost::lexical_cast<std::string>(m.max_v)).c_str(), Green,m.font_Handle[2]); DrawStringToHandle(x,45, (std::string("現在: ")+=boost::lexical_cast<std::string>(counter)).c_str(), Green,m.font_Handle[2]); DrawStringToHandle(x,90, (std::string("時間: ")+=boost::lexical_cast<std::string>( std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now()-start).count() )).c_str(), Green,m.font_Handle[2]); DrawStringToHandle(x,135,"Q: 中止",Green,m.font_Handle[2]); count(counter); if(counter==m.max_v)break; if(CheckHitKey(KEY_INPUT_Q))break; } Rank(std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now()-start),m); }
void graph_type(){ graph_back(); DrawStringToHandle(140,120,"弾幕段位認定",color[0],font[3]); DrawStringToHandle(265,270,"TYPE A",color[0],font[1]); DrawStringToHandle(265,310,"TYPE B",color[0],font[1]); DrawStringToHandle(265,350,"TYPE C",color[0],font[1]); DrawStringToHandle(225,270+(menu_state*40),"→",color[0],font[1]); switch(menu_state){ case 0: DrawStringToHandle(170,450,"自機の当たり判定が少し小さくなります",color[0],font[2]); break; case 1: DrawStringToHandle(60,450,"グレイズ時のゲージ回復量・ピンチ時のゲージ減少量に補正がかかります",color[0],font[2]); break; case 2: DrawStringToHandle(10,450,"どちらのボーナスも受けられない代わりに高ランクが取りやすくなります。上級者向け",color[0],font[2]); break; } }
void Game_DollUniteManager::DrawPreviewBaseSkillList(int _x, int _y, int _alpha) const{ // 見出しの描画 SetDrawBlendMode(DX_BLENDMODE_ALPHA, _alpha); DrawBox( _x, _y, _x + SKILLUNITELIST_PREVIEW_WIDTH-1, _y + FONTSIZE_INFO+4-1, GetColor(64,64,64), 1); DrawStringToHandle( _x+30, _y+2, _T("基本スキル"), GetColor(255,255,255), g_font.hInfo); SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255); for(int n=0; n<BASESKILL_EACHATTR_MAX; n++){ DrawPreviewBaseSkillListCell( _x, _y + (FONTSIZE_INFO+4) + SKILLUNITELIST_PREVIEW_HEIGHT * n, n, _alpha); } }
void Weapon_Draw(){ //武器画像の表示 LoadGraphScreen(0, 0, "hand.jpg", TRUE); LoadGraphScreen(300, 330, "machine2.jpg", TRUE); LoadGraphScreen(0, 450, "sniper.jpg", TRUE); LoadGraphScreen(300, 450, "shotgun.jpg", TRUE); //DrawFormatString(0, 120, BLACK, "%d", weapon_flag); //DrawFormatString(0, 120, BLACK, "%d", weapon_select); DrawStringToHandle(300, 5, "使いたい武器の番号を", RED, font_handle); DrawStringToHandle(300, 35, "キーボードで入力してください", RED, font_handle); DrawStringToHandle(260, 420, "�@", BLACK, font_handle2); DrawStringToHandle(310, 420, "�A", BLACK, font_handle2); DrawStringToHandle(260, 450, "�B", BLACK, font_handle2); DrawStringToHandle(310, 450, "�C", BLACK, font_handle2); DrawStringToHandle(300, 85, "Aさんが選んだ武器は", RED, font_handle); DrawFormatStringToHandle(360, 115, RED, font_handle, "%sです", chara_select_weapon); DrawStringToHandle(300, 145, "Bさんが選んだ武器は", RED, font_handle); DrawFormatStringToHandle(360, 175, RED, font_handle, "%sです", enemy_select_weapon); }
void graph_key(){ graph_back(); DrawStringToHandle(140,120,"弾幕段位認定",color[0],font[3]); DrawStringToHandle(245,240,"決定",color[0],font[1]); DrawFormatStringToHandle(390,240,color[0],font[1],"%d",configpad.shot); DrawStringToHandle(190,280,"キャンセル",color[0],font[1]); DrawFormatStringToHandle(390,280,color[0],font[1],"%d",configpad.bom); DrawStringToHandle(205,320,"低速移動",color[0],font[1]); DrawFormatStringToHandle(390,320,color[0],font[1],"%d",configpad.slow); DrawStringToHandle(225,360,"ポーズ",color[0],font[1]); DrawFormatStringToHandle(390,360,color[0],font[1],"%d",configpad.start); DrawStringToHandle(180,410,"タイトルに戻る",color[0],font[1]); DrawStringToHandle(140,240+(menu_state*40),"→",color[0],font[1]); }
void Window_Selectable::DrawContentItem(int index, BYTE _fontColorType) const{ TCHAR buf[WND_SELECTABLE_TITLELENGTH]; WINDOWAREA tmpArea; int ddx=0; // 中央揃え・右揃えの時の描画位置のずれ tmpArea = GetDrawArea(index, false); GetContent(buf, index); switch(align){ case 0: ddx = 0; break; case 1: ddx = (tmpArea.w - GetStrWidth(buf, strlen(buf), fontBandle.hFont))/2; break; case 2: ddx = tmpArea.w - GetStrWidth(buf, strlen(buf), fontBandle.hFont); break; } int color = 0; switch(_fontColorType){ case WND_SELECTABLE_COLOR_SELECTED: color = GetPresetColor(presetColorIndex, COLORSET_COLOR_ACTIVE); break; case WND_SELECTABLE_COLOR_ACTIVE: color = GetPresetColor(presetColorIndex, COLORSET_COLOR_NORMAL); break; case WND_SELECTABLE_COLOR_INACTIVE: color = GetPresetColor(presetColorIndex, COLORSET_COLOR_INACTIVE); break; } DrawStringToHandle( tmpArea.x+ddx, tmpArea.y, buf, color, fontBandle.hFont); }