本文整理汇总了C++中DrawGraph函数的典型用法代码示例。如果您正苦于以下问题:C++ DrawGraph函数的具体用法?C++ DrawGraph怎么用?C++ DrawGraph使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DrawGraph函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawGraph
void GraphicManager::MoveFade(int fade_left, int fade_frame) {
for (int i=0;i<GlobalValue::LayerMax;i++) {
if (layer[i].enable) {
DrawGraph(GlobalValue::WindowX*(fade_left-fade_frame)/fade_frame+layer[i].x,layer[i].y,layer[i].handle,TRUE);
}
}
for (int i=0;i<GlobalValue::LayerMax;i++) {
if (layer_back[i].enable) {
DrawGraph(GlobalValue::WindowX*fade_left/fade_frame+layer_back[i].x,layer_back[i].y,layer_back[i].handle,TRUE);
}
}
}
示例2: LoadGraph
// 説明画面表示
void Display::Introduction()
{
// 説明画面画像の読み込みと表示
if(IsQuarter == IDYES){
GraphHandle_Introduction = LoadGraph("img\\q_introduction.png");
DrawGraph(0, 0, GraphHandle_Introduction, TRUE);
}else{
GraphHandle_Introduction = LoadGraph("img\\n_introduction.png");
DrawGraph(0, 0, GraphHandle_Introduction, TRUE);
}
//ScreenFlip();
}
示例3: OpeningDraw
void OpeningDraw() {
OpeiningCount++;
if (OpeiningCount >= 1 && OpeiningCount != 0) {
int OpeiningCountFrame = (OpeiningCount / 120);
if ((OpeiningCount / 120) > 3) {
OpeiningCountFrame = 3;
}
DrawGraph(0, 0, Opening[OpeiningCountFrame], TRUE);
} else {
DrawGraph(0, 0, Opening[0], TRUE);
}
}
示例4: DrawCharaGraph
void DrawCharaGraph(int num){
switch(num){
case 1:
DrawGraph(400,50,graph::chara[0],true);
break;
case 2:
DrawGraph(50,50,graph::chara[1],true);
break;
case 3:
DrawGraph(200,50,graph::chara[2],true);
break;
}
}
示例5: SetDrawBlendMode
void GraphicManager::CrossFade(int fade_left, int fade_frame) {
SetDrawBlendMode(DX_BLENDMODE_ALPHA,255*(fade_frame-fade_frame_left)/fade_frame);
for (int i=0;i<GlobalValue::LayerMax;i++) {
if (layer_back[i].enable) {
DrawGraph(layer_back[i].x,layer_back[i].y,layer_back[i].handle,TRUE);
}
}
SetDrawBlendMode(DX_BLENDMODE_ALPHA,255*fade_frame_left/fade_frame);
for (int i=0;i<GlobalValue::LayerMax;i++) {
if (layer[i].enable) {
DrawGraph(layer[i].x,layer[i].y,layer[i].handle,TRUE);
}
}
}
示例6: DrawGraph
void Mobu::Draw1(int movex,int movey){
extern int cell;
//静止状態
if(!hide){
if(!mobumove){
movecount = 0;
DrawGraph(cell*7+cell/2 + fieldx*cell + movex,cell*7+cell/2 + fieldy*cell + movey,src[srcSelect],TRUE );
}
//移動中
else{
movecount++;
DrawGraph(cell*7+cell/2 + fieldx*cell + movex + mobumovex,cell*7+cell/2 + fieldy*cell + movey + mobumovey,src[srcSelect + movecount/4%4],TRUE );
}
}
}
示例7: GetMousePoint
void MusicApple::Draw()
{
GetMousePoint(&mousex, &mousey);
if(sqrt(pow(((double)mousex-x), 2)+pow(((double)mousey-y), 2)) <= hit_area){
hit_area = 90;
//DrawCircle(this->x, this->y, hit_area, this->color, true);
DrawGraph(this->x-100, this->y-108, graphic_h_b, true);
}else{
hit_area = 30;
//DrawCircle(this->x, this->y, MUSICAPPLE_HIT_AREA, this->color, true);
DrawGraph(this->x-34, this->y-37, graphic_h_s, true);
}
//DrawCircle(this->x, this->y, 30, this->color, true);
}
示例8: Battle
int Battle( Character_t *Character, int EnemyType){
DrawGraph(0,0,BackGround,TRUE);
MessageFrame();
DrawFormatString( 60, 140, GetColor(255, 255, 255), " LV:%d ",Character->LEVEL) ;
DrawGauge( 15, 16, Character->MaxHP, Character->HP, GetColor( 0, 255, 0 ), GetColor(0, 255/2, 0),TRUE);
DrawGauge( 15, 31, Character->MaxMP, Character->MP, GetColor( 255, 255, 0 ),GetColor( 255/2, 255/2, 0 ),TRUE );
DrawGraph(Enemy[EnemyType].X, Enemy[EnemyType].Y, Enemy[EnemyType].Graph, TRUE);
// 現れたとこ
if(move==0){if(DrawBattleMessage( 0, 2, BattleMenuString, 0, EnemyType, TRUE) == 1 )move=1;}
// 選択
if(move==1)switch( DrawMenu( 2, 2, KEY_INPUT_Z, BattleMenu) ){
// 速度判定
case 0:backmenu=0;if( Character->Speed >= Enemy[EnemyType].Speed ){
Damage=DamageCalc2( *Character, &Enemy[EnemyType]);move=3;
}else {
Damage=DamageCalc2( Enemy[EnemyType], Character);move=5;
}break;
case 1:break;
case 2:move=2;break;
case 3:break;
}
//逃げ出す勇者の処理
if(move==2)if( DrawBattleMessage( 2, 3, BattleMenuString, 0, EnemyType,FALSE) == 1 ){move=0;Enemy[EnemyType].HP = Enemy[EnemyType].MaxHP ;return 2;}
// 的にダメージを与える処理 中かっこの中には勝った時の処理
if(move==3)if(DamageCalc3( Character, &Enemy[EnemyType], 3, 5, 5, EnemyType, FALSE)==1){
Character->Ex += Enemy[EnemyType].Ex ;
Enemy->HP = Enemy[EnemyType].MaxHP ;
move=0 ;
return 2 ;
}
// 敵のダメージを与える分を表示 中かっこの中には負けた時の処理
if(move==5)if(DamageCalc3( &Enemy[EnemyType], Character, 5, 7, 3, EnemyType, TRUE)==1){
move=0 ;
return 0 ;
}
return 4 ;
}/*
示例9: switch
/*背景描画*/
void TextGraphClass::DrawBack(UserClass &User){
//背景描画
switch( User.GetBackCode() ){
case GAME_BACK::KAWARA:
DrawGraph(GameBackPoint[GRAPH::X],GameBackPoint[GRAPH::Y],GameBackHandle[GAME_BACK::KAWARA],TRUE);
break;
case GAME_BACK::YOZORA:
DrawGraph(GameBackPoint[GRAPH::X],GameBackPoint[GRAPH::Y],GameBackHandle[GAME_BACK::YOZORA],TRUE);
break;
case GAME_BACK::BLACK:
DrawBox(0,0,windowX,windowY,GetColor(0,0,0),TRUE);
break;
}
}
示例10: f
void NetworkWidget::DoUpdate()
{
QFile f(QString(GetFile("/proc/net/dev", false).c_str()));
f.open(QIODevice::ReadOnly);
QTextStream stream(&f);
QString contents = stream.readAll();
f.close();
contents.replace(":", " ");
contents.replace("\n", " ");
size_t val = 0;
QStringList l = contents.split(" ", QString::SkipEmptyParts);
for (size_t i = 0; i < l.length(); ++i)
{
if (l[i].toStdString() == interface)
{
if (down)
{
// On 32-bit archs it's possible to overflow size_t, so truncate to only the
// last nine digits. If you need to be able to measure more than a gigabyte of
// bandwidth, switch to 64-bits. :-)
if (sizeof(val) > 4)
val = l[i + 1].toULong();
else
val = l[i + 1].right(9).toULong();
}
else
{
if (sizeof(val) > 4)
val = l[i + 9].toULong();
else
val = l[i + 9].right(9).toULong();
}
break;
}
}
size_t currbytes = val;
int elapsed = timer.restart();
float rate = (currbytes - lastbytes) / (float(elapsed) / 1000.f) / float(KB());
rate = floor(rate * 10.f) / 10.f;
lastbytes = currbytes;
float percent = rate / max;
if (type == Text)
{
QString qrate;
qrate.setNum(rate);
QString text = format;
text.replace("%s", qrate);
SetText(text);
}
else if (type == Image)
{
SetLabelMask(percent);
}
else if (type == Graph)
{
DrawGraph(percent);
}
}
示例11: DrawGraph
void CBoard::draw(int point, int quota, std::string statement1, std::string statement2) {
// 背景画像
DrawGraph(0, 0, ghandle_background, TRUE);
// 箱が通る線
DrawBox(0, 295, 800, 305, blue, TRUE);
DrawBox(450, 295, 600, 305, red, TRUE);
// 説明文
DrawFormatStringToHandle(30, 120, white, font3, "ベルトレーラーが光っている時,");
DrawFormatStringToHandle(30, 150, white, font3, "答えが正解だと思ったらZキーを押そう。");
DrawFormatStringToHandle(30, 180, white, font3, "違うと思ったらスルーだ!");
// 得点表示
DrawFormatStringToHandle(600, 500, white, font1, "得点:");
if(point > quota) DrawFormatStringToHandle(690, 500, light_blue, font1, "%d", point);
else if(point == quota) DrawFormatStringToHandle(690, 500, white, font1, "%d", point);
else DrawFormatStringToHandle(690, 500, light_red, font1, "%d", point);
// ノルマ表示
DrawFormatStringToHandle(50, 500, white, font1, "ノルマ: %d", quota);
// 問題文表示
DrawFormatStringToHandle(50, 50, white, font1, statement1.c_str());
DrawFormatStringToHandle(50, 80, white, font1, statement2.c_str());
}
示例12: DrawGraph
/*背景描画*/
void SecretGraphClass::DrawBack(){
DrawGraph(BackgroundPoint[GRAPH::X],BackgroundPoint[GRAPH::Y],BackgroundHandle,TRUE);
SetDrawBlendMode(DX_BLENDMODE_ALPHA,120);
DrawBox(50,50,windowX-50,windowY-50,GetColor(0,0,0),TRUE);
SetDrawBlendMode(DX_BLENDMODE_NOBLEND,0);
DrawLine(500,100,500,windowY-100,GetColor(0,0,0));
}
示例13: GetNowCount
//@Anten,@Meiten,@BackGround_Change用のフェードインアウト処理
void CWorldManager::FadeDraw(int _time, int _img, bool _changeahead, bool _color){
int starttime = GetNowCount() ;
int alpha;
if (!_color && !_changeahead) {int tmp = _img; _img = ImgBackGround; ImgBackGround = tmp;}
while(GetNowCount()-starttime<_time){
if (_changeahead){
alpha = 255 * (GetNowCount()-starttime)/_time;
}else{
alpha = 255 - 255 * (GetNowCount()-starttime)/_time;
}
SetDrawBlendMode( DX_BLENDMODE_NOBLEND , 0 );
Draw(false, true); //Draw()内でScreenFlipなどはしない
SetDrawBlendMode( DX_BLENDMODE_ALPHA, alpha);
if (_color){
DrawBox(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, _img, true); //DrawBox使わない方が軽いらしい$
}else{
CVector picsize = GetGraphSize(_img);
DrawGraph(WINDOW_WIDTH/2-picsize.x/2, WINDOW_HEIGHT/2-picsize.y/2, _img, true);
}
if(!BasicLoop() ) break;
}
if (!_color && _changeahead) ImgBackGround = _img;
SetDrawBlendMode( DX_BLENDMODE_NOBLEND , 0 );
}
示例14: DrawGraph
void Ocean::on_clearButton_clicked()
{
ui->SizeFieldBox->setEnabled(true);
ui->generationButton->setEnabled(true);
ui->comboBox->setCurrentIndex(0);
ui->AmountStones->setEnabled(true);
ui->Amount_Predators->setEnabled(true);
ui->Amount_Victims->setEnabled(true);
ui->deadStep_Predators->setEnabled(true);
ui->razmnozh_Predators->setEnabled(true);
ui->razmnozh_Victims->setEnabled(true);
ui->countPredators->setText(QString::number(ui->Amount_Predators->value()));
ui->countVictims->setText(QString::number(ui->Amount_Victims->value()));
predators.erase(predators.begin(), predators.end());
victims.erase(victims.begin(), victims.end());
for (int i = 0; i < SizeField; i++)
for (int j = 0; j < SizeField; j++)
area[i][j].who=0;
massPointVictims.erase(massPointVictims.begin(), massPointVictims.end());
massPointPredators.erase(massPointPredators.begin(), massPointPredators.end());
DrawGraph(predators.size(), victims.size());
ocean->RecieveInit(area);
}
示例15: WinMain
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
ChangeWindowMode(TRUE);
DxLib_Init();
SetDrawScreen(DX_SCREEN_BACK);
int handle = LoadGraph("image/backGround.png");
GameManager *gameMgr;
gameMgr = new GameManager();
/*初期化処理*/
gameMgr->initialize();
while (!ProcessMessage() && !ScreenFlip() && !ClearDrawScreen())
{
/*キーボードアップデート*/
KeyboardInput::Instance()->update();
if (KeyboardInput::Instance()->get(KEY_INPUT_ESCAPE) == 1){ break; }
DrawGraph(0, 0, handle, FALSE);
/*メイン処理*/
gameMgr->execute();
}
/*終了処理*/
gameMgr->finalize();
delete gameMgr;
DxLib_End();
return 0;
}