當前位置: 首頁>>代碼示例>>C++>>正文


C++ DrawFormatString函數代碼示例

本文整理匯總了C++中DrawFormatString函數的典型用法代碼示例。如果您正苦於以下問題:C++ DrawFormatString函數的具體用法?C++ DrawFormatString怎麽用?C++ DrawFormatString使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了DrawFormatString函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: DrawFormatString

void BmsPlayer::drawInterface(unsigned long long time){
	DrawFormatString(450, 60, GetColor(255, 255, 255), "GENRE : %s", parser->getHeader("GENRE").c_str());
	DrawFormatString(450, 75, GetColor(255, 255, 255), "TITLE : %s", parser->getHeader("TITLE").c_str());
	DrawFormatString(450, 90, GetColor(255, 255, 255), "ARTIST: %s", parser->getHeader("ARTIST").c_str());
	DrawFormatString(450, 105, GetColor(255, 255, 255), "BPM   : %s", parser->getHeader("BPM").c_str());
	DrawFormatString(450, 120, GetColor(255, 255, 255), "TIME  : %d", time);

	double visible_area;
	for (int j = 0; j <= 7; j++){
		for (int note_num = visnote_begin.at(j); note_num < visnote_size.at(j); note_num++){
			visible_area = ((double)visible_notes(j).at(note_num).second - time) / visible_time;
			// 範囲外
			if (visible_area > 1){
				break;
			}
			if (visible_area < 0)
				visnote_begin.at(j)++;
			// 範囲內
			else{
				// 描畫
				double y = ((double)visible_notes(j).at(note_num).second - time) / visible_time;
				system_graph.drawkey(j, 480 - (y * 480)); // y座標は LIFT - (y * SUD+), 0 <= x < 480 
			}
		}

	}
}
開發者ID:h1dia,項目名稱:BMSPlayer,代碼行數:27,代碼來源:player.cpp

示例2: DrawFormatString

void CTurn::SkipTurn(){
	if(turn<10){
		DrawFormatString(810,25,GetColor(255,255,255),"  %d",turn);
	}

	if(turn>=10 && turn<100){
		DrawFormatString(810,25,GetColor(255,255,255)," %d",turn);
	}

	if(turn>=100){
		DrawFormatString(810,25,GetColor(255,255,255),"%d",turn);
	}

	skip=false;

	if(Event.key.GetDown(Event.key.RETURN)){
		if(country==COUNTRY_NUM){
			turn++;
			country=1;
		}else{
			country++;
		}

		skip=true;
	}
}
開發者ID:Yasufu12,項目名稱:Strategy2,代碼行數:26,代碼來源:General.cpp

示例3: DrawFormatString

void Message::magic_attack(const char* chant_magic, cint magic_sound_handle) {
	this->window_box();
	if (this->print_in_kanji) DrawFormatString(this->message_window.x + 5, this->message_window.y + 5, this->message_window.string_color, "%sは%sを唱えた!", this->attacker.c_str(), chant_magic);
	else DrawFormatString(this->message_window.x + 5, this->message_window.y + 5, this->message_window.string_color, "%sは%sをとなえた!", this->attacker.c_str(), chant_magic);
	ScreenFlip();
	PlaySoundMem(magic_sound_handle, DX_PLAYTYPE_NORMAL);
}
開發者ID:AinoMegumi,項目名稱:DefeatMonster.old,代碼行數:7,代碼來源:Message.cpp

示例4: draw_result

	void draw_result()
	{
		DrawFormatString(0,0,0xffffff,"Bボタンでタイトルに戻る");
		SetFontSize(40);
		DrawFormatString(Csystem::SCREEN_WIDTH/2 - 90,40,0xff5555,"敵撃破數%3d體",Csystem::destroy_enemy);
		SetFontSize(17);
	}
開發者ID:Doku0911,項目名稱:3DFrstContact,代碼行數:7,代碼來源:system.cpp

示例5: DrawFormatString

void Explosion::DrawTest()
{
//	DrawGraph(0, 0, gh_explo[1], true);

	for (int i = 0; i < 3; i++)
		DrawFormatString(130, 20 + (i * 20), GetColor(0, 255, 0), "c[%d] = %d", i, c_play[i]->GetNowcount());
	DrawFormatString(100, 100, GetColor(0, 255, 0), "speed[0].x = %lf", speed[0].x);
	DrawFormatString(100, 120, GetColor(0, 255, 0), "speed[0].x = %lf", speed[0].y);
}
開發者ID:nitorionedan,項目名稱:GekiRenSha,代碼行數:9,代碼來源:Explosion.cpp

示例6: DrawFormatString

void CDraw::DrawNumber(int x,int y,int color,int num){
	if(num>=100){
	DrawFormatString(x,y,color,"%d",num);
	}else if(num>=10){
		DrawFormatString(x,y,color," %d",num);
	}else{
		DrawFormatString(x,y,color,"  %d",num);
	}
}
開發者ID:Yasufu12,項目名稱:Strategy,代碼行數:9,代碼來源:General.cpp

示例7: DrawGraph

// マップとプレイヤーの描畫(クォータービューでない時)
void Display::disp_map()
{	
	int MapDrawPointX , MapDrawPointY ;      // 描畫するマップ座標値
	int DrawMapChipNumX , DrawMapChipNumY ;	 // 描畫するマップチップの數

	// 描畫するマップチップの數(量)をセット
	DrawMapChipNumX = SCREEN_SIZE_X / ChipSizeX + 1 ;
	DrawMapChipNumY = SCREEN_SIZE_Y / ChipSizeY + 1 ;

	// 畫麵左上に描畫するmap配列の番號をセット
	MapDrawPointX = player.chara_x - ((SCREEN_SIZE_X/2)/ChipSizeX);
	MapDrawPointY = player.chara_y - ((SCREEN_SIZE_Y/2)/ChipSizeY);

	// 描畫
	for(int j = MapDrawPointY; j < (MapDrawPointY + DrawMapChipNumY); j++)
	{
		for(int i = MapDrawPointX; i < (MapDrawPointX + DrawMapChipNumX); i++)
		{
			// 畫麵からはみ出た位置は描畫しない
			if(i < 0 || j < 0 || i >= MAP_W || j >= MAP_H )
			{
				continue;
			}
			// マップチップの描畫
			if(map[i][j] == ROOM || map[i][j] == PATH || map[i][j] == PATH_FRONT || map[i][j] == PATH_OF_WALL || map[i][j] == APPEND_PATH){
				DrawGraph((i - MapDrawPointX)*ChipSizeX, (j - MapDrawPointY)*ChipSizeY, GraphHandle_Floorchip, TRUE);
			}
			// アイテムの描畫
			if(item_map[i][j] == ITEM){
				DrawGraph((i - MapDrawPointX)*ChipSizeX, (j - MapDrawPointY)*ChipSizeY, GraphHandle_Item, TRUE);
			}
			// 殘りアイテム數表示
			int Color = GetColor(255, 255, 255);
			DrawFormatString(0, 0, Color, "殘り:%d", LeftItemNum);
			DrawFormatString(0, 20, Color, "長さ:%d", Player_Length);
		}
	}

	// キャラクターだけ描畫
	for(int j = MapDrawPointY; j < (MapDrawPointY + DrawMapChipNumY); j++)
	{
		for(int i = MapDrawPointX; i < (MapDrawPointX + DrawMapChipNumX); i++)
		{
			// プレイヤーの描畫
			if(chara_map[i][j] == PLAYER){
				DrawGraph((i - MapDrawPointX)*ChipSizeX, (j - MapDrawPointY)*ChipSizeY, GraphHandle_Player, TRUE);
				// しっぽの描畫
				if(Player_Length != 0){
					tail_disp(i, j, MapDrawPointX, MapDrawPointY);
				}
			}
		}
	}

	WaitTimer(100);
}
開發者ID:OchaParadise,項目名稱:casnake,代碼行數:57,代碼來源:Display.cpp

示例8: i

void BmsPlayer::bmsSoundTest(){
	ChronoTimer timer, calcflame;
	FpsTimer fps;
	std::vector<int> i(1296, 0);

	while (ProcessMessage() == 0){
		play_channel_sound(1, timer.GetLapTime());
		for (int j = 11; j < 20; j++){
			play_channel_sound(j, timer.GetLapTime());
		}

		// TODO : play_channel_graph関數がめっちゃ重い
		//i.at(4) += play_channel_graph(4, i.at(4), timer.GetLapTime());

		if (calcflame.GetLapTime() >= (1.0 / GetRefreshRate()) * 1000000){
			DrawFormatString(0, 0, GetColor(255, 255, 255), "SoundTest");
			DrawFormatString(0, 15, GetColor(255, 255, 255), "GENRE : %s", parser->getHeader("GENRE").c_str());
			DrawFormatString(0, 30, GetColor(255, 255, 255), "TITLE : %s", parser->getHeader("TITLE").c_str());
			DrawFormatString(0, 45, GetColor(255, 255, 255), "ARTIST: %s", parser->getHeader("ARTIST").c_str());
			DrawFormatString(0, 60, GetColor(255, 255, 255), "BPM   : %s", parser->getHeader("BPM").c_str());
			DrawFormatString(0, 75, GetColor(255, 255, 255), "TIME  : %d", timer.GetLapTime());
			DrawFormatString(0, 90, GetColor(255, 255, 255), "內部FPS : %d", fps.GetLapTime());
			DrawFormatString(0, 120, GetColor(255, 255, 255), "解像度 : %d(us)", fps.GetDiff());
			DrawFormatString(0, 135, GetColor(255, 255, 255), "RefLate : %d", GetRefreshRate());

			ScreenFlip();
			ClearDrawScreen();
			calcflame.ResetTime();
			fps.ResetTime();
		}
	}

	InitSoundMem();
}
開發者ID:h1dia,項目名稱:BMSPlayer,代碼行數:34,代碼來源:player.cpp

示例9: DrawBattleMessage

// 會話などを表示する,UseBeforeZが1の場合
static int DrawBattleMessage(int Start, int End, StringScript_t MenuString[], int Damage, int EnemyName, int UseBeforeZ){
	if(End<NowNumber+Start+UseBeforeZ){ NowNumber=0;return 1; }
	for( int i=Start; i<(NowNumber+Start+UseBeforeZ); i++){
		if( i==5 || i==0)DrawFormatString(MenuString[i].x,MenuString[i].y,MenuString[i].color,MenuString[i].hyoji,Enemy[EnemyName].Name);
		else DrawFormatString(MenuString[i].x,MenuString[i].y,MenuString[i].color,MenuString[i].hyoji,Damage);
		DrawFormatString(0,200+(i*20),GetRainbowColor(),"%d",i);
	}
	DrawFormatString(40,200,GetRainbowColor(),"%d",NowNumber);
	if(CheckHitKey2(KEY_INPUT_Z)==1)NowNumber++;
	return 0;
}
開發者ID:ykprogram,項目名稱:rpg,代碼行數:12,代碼來源:Battle.cpp

示例10: GetColor

void Subweponbox::Draw(){
	int height = 16;

	int color = GetColor(255,255,255);
	DrawFormatString(0, 0,color,"Equipments:[slot1:[%d], slot2:[%d]]",mEqipment[0],mEqipment[1]);
	DrawFormatString(0,height,color,"Have Subwepons");
	for(int i=0;i<MaxBox;i++){
		DrawFormatString(0,(i*height)+30,color,
			"SW[%d]:[Name:%s, Damage:%d]",
			i, mSubwepon[i].GetStatus().Name.c_str(), mSubwepon[i].GetStatus().Damage
		);
	}

}
開發者ID:kazenoarika,項目名稱:AirBreakers,代碼行數:14,代碼來源:Subweponbox.cpp

示例11: text

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);

}
開發者ID:mdonaka,項目名稱:Nproject,代碼行數:15,代碼來源:title.cpp

示例12: drawScene

void drawScene()
{

    /*
    tiny3d_Project3D();
    tiny3d_SetProjectionMatrix(NULL);

	DrawBackground3D(0xffff00ff) ; // yellow
   */

    tiny3d_Project2D(); // change to 2D context (remember you it works with 848 x 512 as virtual coordinates)

    // fix Perspective Projection Matrix

    DrawBackground2D(0x0040ffff) ; // light blue 


    SetFontSize(16, 24);
    SetFontColor(0xffffffff, 0x0);

    SetFontAutoCenter(1);
    DrawString(0, (512 - 24)/2 - 64, "Use LEFT/RIGHT/UP/DOWN to adjust the screen");

    DrawFormatString(0, (512 - 24)/2, "Video Scale X: %i Y: %i", videoscale_x, videoscale_y);

    DrawString(0, (512 - 24)/2 + 64, "Press 'X' to exit");
    SetFontAutoCenter(0);
  
    
}
開發者ID:Estwald,項目名稱:PSDK3v2,代碼行數:30,代碼來源:main.c

示例13: ranking

void ranking(AI_T ai[],int deth[]){
	int hoge,Cr;
	int j ;
	for(int i=0;i<AI_NUM;i++){

		ai[i].life = deth[i];
		j=i;
		//main関數よりdeth[]を引數に取り、小さい順に並び替え
		while(j>0&&deth[j-1]>deth[j]){
			hoge = deth[j-1];
			deth[j-1] = deth[j];
			deth[j] = hoge;
			j--;
		}
	}
	
	for(int i = 0;i<AI_NUM;i++){

		for(int k=0;k<AI_NUM;k++){

		if(ai[k].life==deth[i]){
			Cr = colswitch(i+1);

			DrawFormatString(50,200+i*20,Cr,"%d 位 %d 回",i+1,deth[i]);

			DrawString(130,200+i*20,ai[k].name,GetColor(255,0,0));

			DrawGraph(170,200+i*20,ai[k].Graph,TRUE);
		}
		}
	}

}
開發者ID:matsushin1222251,項目名稱:2012TeResAI,代碼行數:33,代碼來源:Ranking.cpp

示例14: DrawRotaGraph

void Menu::Draw()
{
	title->Draw();													// タイトル
	if ( !title->isStop )	return;									// タイトルが止まってないならスルー	

	graphic->DrawMyString2(X, y[0], "START",    SPACE, true,  2.0);
	graphic->DrawMyString2(X, y[1], "CONTINUE", SPACE, true,  2.0);
	graphic->DrawMyString2(X, y[2], "CONFIG",   SPACE, true,  2.0);
	graphic->DrawMyString2(X, y[3], "QUIT",     SPACE, false, 2.0);

	// その他の情報
	graphic->DrawMyString2(140, 440, "SINCE 2015   SHOPPE YAHU!", SPACE, true, 2.0);
	DrawRotaGraph(320, 466, 2.0, 0.0, h_twi, true);					// ツイッター
	DrawRotaGraph(X_CUR, y_cur, 2.0, 0.0, h_cursor, true);			// カーソル
	score->Draw();													// スコア表示

	if (isGame)
	{
		DrawBox(0, 0, 640, 480, GetColor(0, 0, 0), TRUE);
		graphic->DrawMyString2(60, 180, "STANDBY READY?", 40, false, 4.0);
		graphic->DrawMyString2(140, 260, "GOOD LUCK!", 40, false, 4.0);
	}

	// TEST
	if (!DebugMode::isTest)	return;

	DrawFormatString(0, 50, GetColor(0, 255, 0), "ano_tri = %d", ano_tri);
}
開發者ID:nitorionedan,項目名稱:TestGeki,代碼行數:28,代碼來源:Menu.cpp

示例15: WinMain

int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int){
	ChangeWindowMode(TRUE), DxLib_Init(), SetDrawScreen( DX_SCREEN_BACK ); //ウィンドウモード変更と初期化と裏畫麵設定
	SetGraphMode(512,512,16) ;//ディスプレイの大きさの設定

	SceneMgr sceneMgr;
    sceneMgr.Initialize();


	while( ScreenFlip()==0 && ProcessMessage()==0 && ClearDrawScreen()==0 && gpUpdateKey()==0 ){
        sceneMgr.Update();  //更新
        sceneMgr.Draw();    //描畫
		fps();
		if(Keyboard_Get(KEY_INPUT_F1) == 1){
			debbattle = !debbattle;
		}
		if(debbattle){
		    DrawFormatString(0, 10,GetColor(255,255,255),"battle:true");
		}
		fpsc++;
	}

	sceneMgr.Finalize();
	DxLib_End();	// DXライブラリ終了処理
	return 0;
}
開發者ID:jinopapo,項目名稱:Hoshi_wo_miru_hito,代碼行數:25,代碼來源:Main.cpp


注:本文中的DrawFormatString函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。