void CPicture::LoadButtonPic(){ closeButton[0] = LoadGraph("Chikuwa2/Close.png"); closeButton[1] = LoadGraph("Chikuwa2/AskClose.png"); saveButton[0] = LoadGraph("Chikuwa2/SaveButton.png"); saveButton[1] = LoadGraph("Chikuwa2/SaveButtonAsk.png"); saveButton[2] = LoadGraph("Chikuwa2/SaveButtonEnd.png"); }
int Load_Title_Rand(){//乱数でタイトル背景を起動するたびに変える SRand(GetRand(100));//乱数シードを変える int BG = GetRand(3);//乱数で背景を決める int BG_jpg;//画像ハンドル保存用の変数 switch (BG + 1){//乱数の値によって分岐 case 1: BG_jpg = LoadGraph("Pics/BG_Title_01.jpg"); break; case 2: BG_jpg = LoadGraph("Pics/BG_Title_02.jpg"); break; case 3: BG_jpg = LoadGraph("Pics/BG_Title_03.jpg"); break; case 4: BG_jpg = LoadGraph("Pics/BG_Title_04.jpg"); break; default://1~4以外が出た場合1の画像(保険) BG_jpg = LoadGraph("Pics/BG_Title_01.jpg"); break; } return BG_jpg; }
Dungeon::Dungeon() { black = GetColor(0, 0, 0); yellow = GetColor(255, 255, 0); white = GetColor(255, 255, 255); blue = GetColor(0, 0, 255); SetTransColor(255, 255, 255); //白を透過色に yajirushi_h = LoadGraph("./dungeon/yajirushi.png"); SetTransColor(0, 0, 0); //一応戻す event_h = LoadGraph("./img/2bikkuri.bmp"); if (yajirushi_h == -1) { DrawString(0, 0, "Error!", GetColor(255, 0, 0)); WaitKey(); } SetUseZBuffer3D(TRUE); //深度ステンシルバッファ SetWriteZBuffer3D(TRUE); //。今のところ必要ない…と思いきや、一方通行の壁が荒ぶることへの対処ができる。一瞬暗くなるのは仕方ない? option = Option::GetInstance(); savedata = SaveData::GetInstance(); menu = Menu::GetInstance(); player = new Player(Prologue::RIAJU); LoadDungeon(3); }
void Button::load(const char* active, const char* push, const char* inactive) { graphHandle[Active] = LoadGraph(active); graphHandle[Inactive] = LoadGraph(inactive); graphHandle[Push] = LoadGraph(push); GetGraphSize(graphHandle[Active], &size.width, &size.height); }
void CTalkName::Init(){ ImgLabel[0] = LoadGraph("tenyu_data/pic/talkname00.png", true); ImgLabel[1] = LoadGraph("tenyu_data/pic/talkname01.png", true); ImgLabel[2] = LoadGraph("tenyu_data/pic/talkname02.png", true); }
void CPicture::LoadResultPic(){ result = LoadGraph("Chikuwa2/GameOver.png"); lFlag[1] = LoadGraph("Chikuwa2/Lcountry1.png"); lFlag[2] = LoadGraph("Chikuwa2/Lcountry2.png"); lFlag[3] = LoadGraph("Chikuwa2/Lcountry3.png"); lFlag[4] = LoadGraph("Chikuwa2/Lcountry4.png"); }
void InitPicture(void){ GrHandle[0]=LoadGraph("test1.bmp"); GrHandle[1]=LoadGraph("dialog_LOAD.bmp"); GrHandle[2]=LoadGraph("panel1.bmp"); GrHandle[3]=LoadGraph("panel2.bmp"); GrHandle[4]=LoadGraph("panel3.bmp"); return; }
void Battle_Iniβ(){ DrawIni=LoadGraph("RPG DATA\\cursor.png"); EnemyStatus[0].Graph = LoadGraph( EnemyStatus[0].Pass ); EnemyStatus[1].Graph = LoadGraph( EnemyStatus[1].Pass ); for( int i=0; i<10; i++ )BattleMenuString[i]=BattleMenuString2[i]; }
void Player::initialize() { m_hand->initialize(); m_state = NULL; m_stateAnimation = NULL; m_bets = 0; m_buttonHandle = LoadGraph("image/testButton.png"); m_10ButtonHandle = LoadGraph("image/+10Button.png"); }
//--------------------------------------------------------------------- void TitleDraw::loadImage() { image_circle_logo = LoadGraph("image/title/circle_logo.png"); image_title_back = LoadGraph("image/title/title_back.png"); LoadDivGraph("image/title/title_button.png", TitleData::getButtonNum() * 2, TitleData::getButtonNum(), 2, TitleData::getButtonSizeX(), TitleData::getButtonSizeY(), image_title_button); }
void CPicture::LoadNumPic(){ numPic[0] = LoadGraph("Chikuwa2/0.png"); numPic[1] = LoadGraph("Chikuwa2/1.png"); numPic[2] = LoadGraph("Chikuwa2/2.png"); numPic[3] = LoadGraph("Chikuwa2/3.png"); numPic[4] = LoadGraph("Chikuwa2/4.png"); numPic[5] = LoadGraph("Chikuwa2/5.png"); numPic[6] = LoadGraph("Chikuwa2/6.png"); numPic[7] = LoadGraph("Chikuwa2/7.png"); numPic[8] = LoadGraph("Chikuwa2/8.png"); numPic[9] = LoadGraph("Chikuwa2/9.png"); }
/*画像ロード*/ void TextGraphClass::Load(){ //背景ロード GameBackHandle.push_back( LoadGraph("./resource/graph/BackGround1.png") ); GameBackHandle.push_back( LoadGraph("./resource/graph/BackGround2.png") ); //キャラクタ描画 CharacterHandle = LoadGraph("./resource/graph/character1.png"); //テキストボックス TextBoxHandle = LoadGraph("./resource/graph/TextBox.png"); }
// 説明画面表示 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(); }
Drawer::Drawer( ) { _num_img = LoadGraph( "../Resources/Number.png" ); _background_img = LoadGraph( "../Resources/Background.png" ); _seeweed_img = LoadGraph( "../Resources/seeweed.png" ); _play = Play::getTask( ); _scene = Scene::getTask( ); _map = MapPtr( new Map ); _select = SelectPtr( new Select ); _ani_timer = 0; _stage_max = _select->getIconNum( ); }
void GraphButton::LoadToMap(std::string name){ std::string loadname = "Images/" + name; std::pair<int, int> handle; handle.first = LoadGraph(loadname.c_str()); handle.second = LoadGraph(loadname.c_str()); GraphFilter(handle.second, DX_GRAPH_FILTER_HSB, 0, 0, 0, 256); std::vector<std::string> extensionList = { ".png", ".jpg" }; for (auto &i : extensionList){ Func::strReplace(name, i, ""); } handlemap.emplace(name, handle); }
//初期化 void Game::Initialize(){ int src[16]; LoadDivGraph("minami_f.png",16,4,4,32,32,src);//主人公の素材 players = new Player[4]; Player minami(src,LoadGraph("minami.png"),LoadGraph("minami2.png"),LoadGraph("minami3.png"),"みなみ",50,30,0,8,10); players[0] = minami; players[0].becameMate(); Player siba(src,LoadGraph("siba.png"),LoadGraph("shiba2.png"),LoadGraph("shiba3.png"),"しば",50,30,1,28,20); players[1] = siba; players[2] = siba; players[3] = siba; players[1].becameMate(); stageMgr.Initialize(); menu.Initialize(players[0].getability(),players[0].getname()); battle.Initialize(); battlemode = false; count = 0; dead = false; src1 = LoadGraph("menu2.png"); src2 = LoadGraph("Dead.png"); white = GetColor(255,255,255); playercount = 2; nowplayer = 0; players[0].setItem("かーど"); playerpoint = new int[3]; }
void CPicture::LoadProductPic(){ productScr = LoadGraph("Chikuwa2/production.png"); close = LoadGraph("Chikuwa2/close.png"); cannot[0] = LoadGraph("Chikuwa2/Can't.png"); cannot[1] = LoadGraph("Chikuwa2/NoMoney.png"); ok = LoadGraph("Chikuwa2/OK.png"); coin = LoadGraph("Chikuwa2/Coin.png"); strength[0] = LoadGraph("Chikuwa2/Str.png"); strength[1] = LoadGraph("Chikuwa2/RStr.png"); strength[2] = LoadGraph("Chikuwa2/SStr.png"); }
void C_ShotManager::SetStateAll(C_Shot::STATE _setState) { for (auto& Shot : ShotList) { Shot.SetState(_setState); } if (BulletGraph[0] == -1) { BulletGraph[0] = LoadGraph("res\\Graph\\Bullet1.png"); BulletGraph[1] = LoadGraph("res\\Graph\\Bullet2.png"); BulletGraph[2] = LoadGraph("res\\Graph\\Bullet3.png"); BulletGraph[3] = LoadGraph("res\\Graph\\Bullet4.png"); } }
CPLErr GNMGenericNetwork::ReconnectFeatures(GNMGFID nSrcGFID, GNMGFID nTgtGFID, GNMGFID nConGFID, double dfCost, double dfInvCost, GNMDirection eDir) { if(!m_bIsGraphLoaded && LoadGraph() != CE_None) { return CE_Failure; } OGRFeature *poFeature = FindConnection(nSrcGFID, nTgtGFID, nConGFID); if (poFeature == NULL) { CPLError( CE_Failure, CPLE_AppDefined, "The connection not exist" ); return CE_Failure; } poFeature->SetField( GNM_SYSFIELD_COST, dfCost ); poFeature->SetField( GNM_SYSFIELD_INVCOST, dfInvCost ); poFeature->SetField( GNM_SYSFIELD_DIRECTION, eDir ); if( m_poGraphLayer->SetFeature( poFeature ) != OGRERR_NONE ) { OGRFeature::DestroyFeature( poFeature ); CPLError( CE_Failure, CPLE_AppDefined, "Failed to update feature." ); return CE_Failure; } OGRFeature::DestroyFeature( poFeature ); // update graph m_oGraph.ChangeEdge(nConGFID, dfCost, dfInvCost); return CE_None; }
CPLErr GNMGenericNetwork::DisconnectFeatures(GNMGFID nSrcGFID, GNMGFID nTgtGFID, GNMGFID nConGFID) { if(!m_bIsGraphLoaded && LoadGraph() != CE_None) { return CE_Failure; } OGRFeature *poFeature = FindConnection(nSrcGFID, nTgtGFID, nConGFID); if (poFeature == NULL) { CPLError( CE_Failure, CPLE_AppDefined, "The connection not exist" ); return CE_Failure; } if (m_poGraphLayer->DeleteFeature(poFeature->GetFID()) != OGRERR_NONE) { OGRFeature::DestroyFeature(poFeature); return CE_Failure; } OGRFeature::DestroyFeature(poFeature); // update graph m_oGraph.DeleteEdge(nConGFID); return CE_None; }
void Font::DrawString(int x,int y,int Space,float ext,string String,string Pass,int Position,float Alpha_Speed) { bool isLoaded = false; int Length = FontIndexs.size(); int i=0; for(i=0;i<Length;i++) { if(FontIndexs[i] == Pass) { isLoaded = true; break; } } if(!isLoaded) {//フォントデータの読み込み vector<int> Images; for(char Alphabet='A';Alphabet<='Z';Alphabet++) { char Str[7]; sprintf_s(Str,7,"/%c.png",Alphabet); Images.push_back(LoadGraph((Pass + Str).c_str())); } FontData.push_back(Images); FontIndexs.push_back(Pass); } int Width = CalculateWidth(0,0,Space,ext,String.c_str(),i); DrawString_UseImage(x-(int)(Width * (Position / 2.0)),y,Space,ext,String.c_str(),i); return; }
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; }
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int){ SetWindowText("Title"); SetGraphMode(WINDOW_WIDTH , WINDOW_HEIGHT,32 ); ChangeWindowMode(TRUE), DxLib_Init(), SetDrawScreen( DX_SCREEN_BACK ); int LoadImage = LoadGraph("Natsuiro/BLOCK/load.png"); DrawExtendGraph(0,0,WINDOW_WIDTH,WINDOW_HEIGHT, LoadImage ,false); ScreenFlip(); SetTransColor(255,0,255); Awake(); long long TIME = GetNowHiPerformanceCount(); # if BENCHMARK == TRUE long long int count = GetNowCount(); # endif while( ScreenFlip()==0 && ProcessMessage()==0 && ClearDrawScreen()==0 && !CheckHitKey(KEY_INPUT_ESCAPE) ){ GameLoop(); Sleep( (unsigned long)max( 16 - (int)( GetNowHiPerformanceCount() - TIME ) / 1000 , 0 ) ); TIME = GetNowHiPerformanceCount(); # if BENCHMARK == TRUE DrawFormatString(WINDOW_WIDTH-200,0,BLACK,"FPS %d (%dms)", (int)( 1000/( GetNowCount() - count ) ) , GetNowCount() - count ); count = GetNowCount(); # endif } DxLib_End(); return 0; }
bool CStar::Appear(int _posx, int _posy, double _speed, int _rand, int _enemykind0, int _enemytime0, int _enemykind1, int _enemytime1, int _enemykind2, int _enemytime2){ ImgStar = LoadGraph("CS_pic/Star.png") ; int ImgBoxes[20]; LoadDivGraph("CS_pic/Boxes.png", 20, 1, 20, 1, 1, ImgBoxes); ImgStarGauge[0] = ImgBoxes[5]; ImgStarGauge[1] = ImgBoxes[6]; Radius = STAR_RADIUS; Pos.Set(_posx + _rand%100 - 50 , _posy+ _rand%112 - 50); Velocity.Set(_rand%10-5, _rand%9-5); Velocity.Multiple(_speed/Velocity.GetLength()); max(1,2); Hp = STAR_HP; TimeGap = _rand%5000; EnemyBirthKind[0]=_enemykind0; EnemyBirthKind[1]=_enemykind1; EnemyBirthKind[2]=_enemykind2; EnemyBirthTime[0]=_enemytime0; EnemyBirthTime[1]=_enemytime1; EnemyBirthTime[2]=_enemytime2; for (int i=0; i<8; i++){ DeadCircleDrawPos[i].Set(0,0); } Alive = true; Visible = true; return true; }
void p12(void) { SetDrawScreen(DX_SCREEN_BACK); int i; char keybuf[256]; int img; i = 0; img = LoadGraph("pic11.png"); while (ProcessMessage() == 0 && GetHitKeyStateAll(keybuf) == 0 && keybuf[KEY_INPUT_ESCAPE] == 0) { ClearDrawScreen(); DrawRotaGraph(120, 239, 1.0, PI / 4.0, img, TRUE); DrawCircle(120, 239, 5, GetColor(255, 0, 0), TRUE); DrawRotaGraph(320, 239, 1.0, PI / 180.0 * i, img, TRUE); DrawCircle(320, 239, 5, GetColor(255, 0, 0), TRUE); DrawRotaGraph2(520, 239, 19, 19, 1.0, PI / 180.0 * i * 2, img, TRUE); DrawCircle(520, 239, 5, GetColor(255, 0, 0), TRUE); ScreenFlip(); i++; } }
void GraphHue::LoadToMap(std::string name){ std::string loadname = "ImagesHue/" + name; HandleArray hArray; int tmp_handle = LoadGraph(loadname.c_str()); int sizeX, sizeY; GetGraphSize(tmp_handle, &sizeX, &sizeY); for (int i = 0; i < colorNum; i++){ hArray.arr[i] = MakeScreen(sizeX, sizeY, TRUE); SetDrawScreen(hArray.arr[i]); int hue = i * 360 / colorNum; SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0); Func::SetDrawBrightHSV(hue, 140, 255); //5回描画することで半透明の黒っぽい部分を消す for (int i = 0; i < 5; i++){ DrawGraph(0, 0, tmp_handle, TRUE); } } SetDrawBright(255, 255, 255); std::vector<std::string> extensionList = { ".png", ".jpg" }; for (auto &i : extensionList){ Func::strReplace(name, i, ""); } handlemap.emplace(name, hArray); }
GameOver::GameOver(ISceneChanger * changer) : BaseScene(changer) , gh(LoadGraph("GRAPH/GAME/GameOver.png")) , time(0) , time_in(0) { }
Block::Block(int x,int y,bool exsit) { this->x = x; this->y = y; this->gh = LoadGraph("./sozai/RengaBlock.png"); this->isExsit = exsit; }
void DemoKeeper::notifyMenuCtrlAccept(wraps::ContextMenu* _sender, const std::string& _id) { if (_id == "SaveGraph") { SaveGraph(); return; } else if (_id == "LoadGraph") { LoadGraph(); return; } else if (_id == "ClearGraph") { ClearGraph(); return; } std::string name = _id; size_t index = name.find("Controller"); if (index != MyGUI::ITEM_NONE) name.erase(index); else { index = name.find("State"); if (index != MyGUI::ITEM_NONE) name.erase(index); } static size_t name_index = 0; name_index++; name = MyGUI::utility::toString(name, "_", name_index); createNode(_id, name); }
bool SceneTitle::Initialize() { std::cout << "SceneTitle" << std::endl; m_backimage = LoadGraph("ayataka.png"); return true; }