本文整理汇总了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
}
}
}
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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();
}
示例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;
}
示例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
);
}
}
示例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);
}
示例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);
}
示例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);
}
}
}
}
示例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);
}
示例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;
}