Exemplo n.º 1
0
void Graphics2D::DrawBlendAdd(const int &X, const int &Y, const double &ExRate_, const double &Angle_, int Blend_ADD, const int &Gr_Handle, bool TransFlag_)
{
	const int& BLEND_ADD = std::min( 255, std::max(0, Blend_ADD) );

	SetDrawBlendMode(DX_BLENDMODE_ADD, BLEND_ADD);					// 加算ブレンドモード
	DrawRotaGraph(X, Y, ExRate_, Angle_, Gr_Handle, TransFlag_);
	SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);						//ブレンドモードをオフ
}
Exemplo n.º 2
0
void Enemy::Draw(){
	if(GetState() != Exist){return;}
	SetDrawBlendMode(DX_BLENDMODE_ADD,GetDrawParam());
	SetDrawMode(1);
	DrawRotaGraph(static_cast<int>(GetX()),static_cast<int>(GetY()),GetDrawExp(),(GetRotateWhenDraw())?GetAngle():0,GetImage(),TRUE);
	SetDrawMode(0);
	SetDrawBlendMode(DX_BLENDMODE_NOBLEND,0);
}
Exemplo n.º 3
0
void graph_menu() {
	DrawBox(0,0,640,480,GetColor(255,255,255),TRUE);
	graph_menu_button();
	if (func_state==51) {
		SetDrawBlendMode( DX_BLENDMODE_ALPHA , (int)(255.0/30.0*menu_selected_cnt) );
		DrawBox(0,0,640,480,GetColor(0,0,0),TRUE);
		SetDrawBlendMode( DX_BLENDMODE_NOBLEND , 0 );
	}
}
void Window_FloatText::DrawContent() const {
    SetDrawBlendMode(DX_BLENDMODE_ALPHA, alpha);
    for(int n=0; n<lines; n++) {
        textLine[n].Draw(
            frameArea.x + contentArea.x,
            frameArea.y + contentArea.y + fontBandle.lineHeight*n,
            -1, frameArea.w, align);
    }
    SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255);
}
Exemplo n.º 5
0
void ChannelChange::Draw()
{
	if (fade_counter_ < 120) {
		SetDrawBlendMode(DX_BLENDMODE_ALPHA, 255 * fade_counter_ / 120);
		int width, height;
		GetScreenState(&width, &height, nullptr);
		DrawBox(0, 0, width, height, GetColor(0, 0, 0), TRUE);
		SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);
	}
}
Exemplo n.º 6
0
void graph_effect(){
	for(int i=0;i<EFFECT_MAX;i++){
		if(effect[i].flag>0){
			if(effect[i].eff==1)//エフェクトが光エフェクトなら
				SetDrawBlendMode( DX_BLENDMODE_ADD, effect[i].brt) ;
			DrawRotaGraphF(effect[i].x+FIELD_X,effect[i].y+FIELD_Y,effect[i].r,effect[i].ang,effect[i].img,TRUE);
			if(effect[i].eff==1)
				SetDrawBlendMode( DX_BLENDMODE_NOBLEND, 0) ;
		}
	}
}
Exemplo n.º 7
0
void Window::ReWindow()
{
	//SetDrawScreen(DX_SCREEN_BACK);
	SetDrawScreen(Screen);
	DrawBox(0,0,Width,Height,GetColor(255,255,255),true);
	SetDrawBlendMode( DX_BLENDMODE_ALPHA, 128);
	DrawBox(0,0,Width,Height,PanelColor,true);
	SetDrawBlendMode( DX_BLENDMODE_ALPHA, 256);
	DrawBox(0,0,Width,Height,EdgeColor,false);
	SetDrawScreen(DX_SCREEN_BACK);
}
Exemplo n.º 8
0
		void BaseTown::MenuExplanation() {
			int posY = mWindow[ 0 ].getHeight() / 4; //ウィンドウサイズを4(list[]の要素数)で割る
			for ( int i = 0; i < 4; ++i ) {
				if ( i == mCursorPosition ) {
					SetDrawBlendMode( DX_BLENDMODE_ALPHA, 190 ); //アルファブレンドモードにセット
					DrawBox( 210, ( posY * i ) + 60, 531, ( posY*i ) + 80, GetColor( 50, 50, 50 ), true );
					SetDrawBlendMode( DX_BLENDMODE_NOBLEND, 255 );
					DrawString( 210, (posY * i)+60, ::explainSelect[ i ], ::WHITE );
				}
			}
		}
void CObject_Bg_Stage4_5::Render()
{
	int _width = 0;
	int _height = 0;

	SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255);
	GetGraphSize(GraphHandle, &_width, &_height); 

	DrawRectGraph((int)fDrawX, (int)fDrawY, SrcX, SrcY, 1024, 768, GraphHandle, TRUE, FALSE);
	DrawRectGraph((int)fDrawX, (int)fDrawY, (SrcX-_width), SrcY+768, 1024, 768, GraphHandle, TRUE, FALSE);
	SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255);
}
Exemplo n.º 10
0
void Stage::drawBrightPoints(){
	for(int h = 0; h < depth; h++){
		for(int w = 0; w < width; w++){
			if(mapchip[h][w].is_brighting){
				SetDrawBlendMode(DX_BLENDMODE_ALPHA, 192);
				DrawBox(getLeftupPositionX() + w*chipsize, getLeftupPositionY() + h*chipsize,
					getLeftupPositionX() + w*chipsize + chipsize, getLeftupPositionY() + h*chipsize + chipsize, mapchip[h][w].bright_color, true);
				SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);
			}
		}
	}
}
Exemplo n.º 11
0
void graph_effect(int knd){
	for(int i=0;i<EFFECT_MAX;i++){
		if(effect[i].flag>0 && effect[i].knd==knd){
			if(effect[i].eff==1)//エフェクトが光エフェクトなら
				SetDrawBlendMode( DX_BLENDMODE_ADD, (int)effect[i].brt) ;
			if(effect[i].eff==2)//エフェクトがαエフェクトなら
				SetDrawBlendMode( DX_BLENDMODE_ALPHA, (int)effect[i].brt) ;
			DrawRotaGraphF(effect[i].x+FX+dn.x,effect[i].y+FY+dn.y,effect[i].r,effect[i].ang,effect[i].img,TRUE);
			if(effect[i].eff==1 || effect[i].eff==2)
				SetDrawBlendMode( DX_BLENDMODE_NOBLEND, 0) ;
		}
	}
}
Exemplo n.º 12
0
void CBoard::result(int point, int quota) {

	// 結果発表画面の表示(半透明にする)
	SetDrawBlendMode(DX_BLENDMODE_ALPHA, 10);
	DrawGraph(0, 250, ghandle_result_background, TRUE);
	SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);

	// ノルマクリアかそうでないか
	if(point >= quota) DrawFormatStringToHandle(250, 275, white, font2, "ノルマクリア!"); 

	else DrawFormatStringToHandle(250, 275, white, font2, "再挑戦しよう!");

}
Exemplo n.º 13
0
void dying::draw(){

	SetDrawBlendMode( DX_BLENDMODE_ALPHA , 255 ) ;
	drawzanzou();
	DrawRotaGraph((int)ptr->mplayer->x, (int)ptr->mplayer->y, 2, PI*0.5, ptr->mplayer->p_GHandle[0], 1);
	ptr->menemy->draw();
	ptr->mstone->drawdiedstone();
	ptr->meffect->draw();
	ptr->mstr_log->draw();
	SetDrawBlendMode( DX_BLENDMODE_ALPHA , (int)(255.0 * (diedtime-240) / 80.0) ) ;
	DrawBox(0,0,800,600, 0x000000, 1);

}
Exemplo n.º 14
0
/*画面描画*/
void ConfigGraphClass::Draw(){
	//マウスインスタンス受け取り
	auto *Mouse = MouseClass::GetInstance();
	
	//変数宣言
	ConfigMenuClass *Menu[5];

	//パラメータセット
	SetMenuParam();

	//インスタンス変数定義
	for( int i=0 ; i<5 ; i++ ){ Menu[i] = new ConfigMenuClass(ConfigParam[i]); }
	MenuClass GlobalMenu(MenuParam);

	//背景描画
	DrawGraph(BackgroundPoint[GRAPH::X],BackgroundPoint[GRAPH::Y],BackgroundHandle,TRUE);
	SetDrawBlendMode(DX_BLENDMODE_ALPHA,100);
	DrawBox(50,100,windowX-50,windowY-144,GetColor(0,0,0),TRUE);
	SetDrawBlendMode(DX_BLENDMODE_NOBLEND,0);

	//画面タイトル
	DrawString(10,10,"— コンフィグ画面 —",GetColor(255,255,255));

	//コンフィグ・グローバルメニュー描画
	for( int i=0 ; i<5 ; i++ ) Menu[i]->Draw();
	GlobalMenu.Create();

	//選択番号取得
	if( Mouse->GetState(MOUSE::LEFT) > 0 ){
		//コンフィグメニューの番号取得
		for( int i=0 ; i<5 ; i++ ){
			if( ConfigParam[i].ListNo != Menu[i]->GetSelectNo() ){
				if( i == 0 ) ConfigData.TextSpeed = Menu[i]->GetSelectNo();
				if( i == 1 ) ConfigData.AutoSpeed = Menu[i]->GetSelectNo();
				//if( i == 2 ) ConfigData.SkipFlag  = Menu[i]->GetSelectNo();
				if( i == 2 ) ConfigData.AllBolume = Menu[i]->GetSelectNo();
				if( i == 3 ) ConfigData.BGMBolume = Menu[i]->GetSelectNo();
				if( i == 4 ) ConfigData.SEBolume  = Menu[i]->GetSelectNo();
			}
		}

		//グローバルメニューの番号取得
		SelectNo = GlobalMenu.GetSelectNo();
	}

	
	
	//オブジェクト開放
	for( int i=0 ; i<5 ; i++ ) delete Menu[i];
}
Exemplo n.º 15
0
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);
        }
    }
}
Exemplo n.º 16
0
void TreasureEffect::Draw(void)
{
	int l_ItemNum = DataManager::GetInstance().m_MogllStatus.treasureStatus;
	DataManager &data = DataManager::GetInstance();
	if( data.m_MogllStatus.treasureStatus != -1 )
	{
		DrawGraph( (int)(800 * m_BackPosition.x), (int)(600 * m_BackPosition.y),
			data.Get( DataManager::Play_GetTreasure_BG ), TRUE);
	}
	if(m_Status == TREASURE_STATUS_WAIT || m_Status == TREASURE_STATUS_ITEMIN || m_Status == TREASURE_STATUS_OUT){
		m_GetTreasure.Draw();		
	}

	DrawItem();

	if(m_Status >= TREASURE_STATUS_ITEMFRAMEIN && m_Status < TREASURE_STATUS_ALLOUT){
		SetDrawBlendMode(DX_BLENDMODE_ALPHA, m_FrameAlpha);
		if(l_ItemNum < 60 && l_ItemNum > -1){
			DrawExtendGraph(static_cast<int>(m_FramePosX)-50,static_cast<int>(m_FramePosY)+150-50,
							770,static_cast<int>(m_FramePosY)+150+250,
							data.Get(DataManager::Icon_Description_Frame),TRUE);
			m_FontManager.DrawFontString(	FontManager::FontSet_AZUKI_W005,
											static_cast<int>(m_FramePosX),static_cast<int>(m_FramePosY)+150,
											m_Message,700,GetColor(0,0,0));
			
		}
		else if(l_ItemNum >= 60){
			DrawExtendGraph(static_cast<int>(m_FramePosX)-60,static_cast<int>(m_FramePosY+100)+150-100,
							770,static_cast<int>(m_FramePosY+180)+150-100,
							data.Get(DataManager::Icon_Description_Frame),TRUE);
			m_FontManager.DrawFontString(	FontManager::FontSet_AZUKI_W004375,
											static_cast<int>(m_FramePosX),static_cast<int>(m_FramePosY+100)+170-100,
											m_Message,700,GetColor(0,0,0));
		}

		SetDrawBlendMode(DX_BLENDMODE_ALPHA, 255);
	}

	if(m_Status >= TREASURE_STATUS_ITEMDESCRIPTION && m_Status < TREASURE_STATUS_ALLOUT){
		SetDrawBlendMode(DX_BLENDMODE_ALPHA, m_DesAlpha);
		if(l_ItemNum < 60 && l_ItemNum > -1){
			m_FontManager.DrawFontString(	FontManager::FontSet_AZUKI_W00375,
											static_cast<int>(m_DesPosX),static_cast<int>(m_DesPosY),
											DataManager::GetInstance().m_SystemData.equip[l_ItemNum].text,600,GetColor(0,0,0));
		}
		SetDrawBlendMode(DX_BLENDMODE_ALPHA, 255);
	}
	
}
Exemplo n.º 17
0
void TreasureEffect::DrawItem(void){
	int l_ItemNum = DataManager::GetInstance().m_MogllStatus.treasureStatus;
	if(m_Status >= TREASURE_STATUS_ITEMIN && m_Status < TREASURE_STATUS_ALLOUT){
		SetDrawBlendMode(DX_BLENDMODE_ALPHA, m_ItemAlpha);
		if(l_ItemNum < 60 && l_ItemNum > -1){
			DrawRotaGraph(	m_ItemPosX,m_ItemPosY,2.0f,0.0f,
							DataManager::GetInstance().GetGraphicGroupData( l_ItemNum  + DataManager::GG_ITEM0), TRUE);
		}
		else if(l_ItemNum >= 60){
			DrawRotaGraph(	m_ItemPosX,m_ItemPosY,0.8f,0.0f,
				DataManager::GetInstance().Get( static_cast<DataManager::GraphicSet>((l_ItemNum - 60) + DataManager::Ic_stage1)),TRUE);
		}
		SetDrawBlendMode(DX_BLENDMODE_ALPHA, 255);
	}
}
Exemplo n.º 18
0
//---------------------------------------------------------------------
void TitleDraw::update()
{
    //---- main content
    int state = title_state->getNowState();
    if (state == TitleState::STATE_CIRCLE) { drawCircle(); }
    if (state == TitleState::STATE_TITLE) { drawTitle(); }

    //---- fadeout/fadein
    SetDrawBlendMode(DX_BLENDMODE_ALPHA, title_state->getAlpha());
    DrawBox(0, 0,
        SystemData::getInstance()->getWindowWidth(),
        SystemData::getInstance()->getWindowHeight(),
        GetColor(0, 0, 0), TRUE);
    SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);
}
Exemplo n.º 19
0
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);
}
Exemplo n.º 20
0
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);
}
Exemplo n.º 21
0
//自由変形描画
void DrawImpl::modi(const Vector2& pos1, const Vector2& pos2, const Vector2& pos3, const Vector2& pos4, int GrHandle, int alpha, int blendMode){
	SetDrawBlendMode(blendMode, alpha);
	DrawModiGraph(
		pos1.x + dx, pos1.y + dy, pos2.x + dx, pos2.y + dy,
		pos3.x + dx, pos3.y + dy, pos4.x + dx, pos4.y + dy,
		GrHandle, 1);
}
Exemplo n.º 22
0
//指定した座標を中心に文字を描画 文字の間隔を指定可能
void DrawImpl::rightTextSpace(const Vector2& pos, int color, int fontHandle, int space, const std::string &str, int alpha, int blendMode){
	SetDrawBlendMode(blendMode, alpha);
	for (int i = 0; i < str.size(); i++){
		double basex = -(double)(str.size()) * space;
		centerText(Vector2(pos.x + i * space + basex, pos.y), color, fontHandle, str.substr(i, 1), alpha, blendMode);
	}
}
Exemplo n.º 23
0
//文字を描画
void DrawImpl::textLine(const Vector2& pos, int color, int fontHandle, const std::string &str, int alpha, HorizontalPlace::en fh, VerticalPlace::en fv, int blendMode){
	Vector2 dPos(0, 0);
	if (fh == HorizontalPlace::en::center){
		dPos.x -= GetDrawFormatStringWidthToHandle(fontHandle, "%s", str.c_str()) / 2.0;
	}
	else if (fh == HorizontalPlace::en::right){
		dPos.x -= GetDrawFormatStringWidthToHandle(fontHandle, "%s", str.c_str());
	}
	if (fv == VerticalPlace::en::center){
		dPos.y -= GetFontSizeToHandle(fontHandle) / 2.0;
	}
	else if (fv == VerticalPlace::en::bottom){
		dPos.y -= GetFontSizeToHandle(fontHandle);
	}

	SetDrawBlendMode(blendMode, alpha);

	size_t preNum = 0;
	size_t num = 0;
	while (1){
		preNum = num;
		num = str.find('\n', num);
		DrawFormatStringToHandle(pos.x + dx + dPos.x, pos.y + dy + dPos.y, color, fontHandle, "%s", str.substr(preNum, num - preNum).c_str());
		if (num == std::string::npos){
			break;
		}
		else{
			dPos += Vector2(0, GetFontSizeToHandle(fontHandle));
			num++;
		}
	}
	textDrawLog.set(pos, color, fontHandle, alpha, blendMode);
}
Exemplo n.º 24
0
//テキストとその背景に
void DrawImpl::textBox(const Vector2& pos, int color, int fontHandle, const std::string &str, int alpha, HorizontalPlace::en fh, VerticalPlace::en fv, const Vector2 &boxMargeV2, int boxColor, int boxAlpha, int blendMode, int boxBlendMode){
	Vector2 dPos(0, 0);
	Vector2 fontSize = Vector2(
		GetDrawFormatStringWidthToHandle(fontHandle, "%s", str.c_str()),
		GetFontSizeToHandle(fontHandle)
		);
	if (fh == HorizontalPlace::en::center){
		dPos.x -= fontSize.x / 2.0;
	}
	else if (fh == HorizontalPlace::en::right){
		dPos.x -= fontSize.x;
	}
	if (fv == VerticalPlace::en::center){
		dPos.y -= fontSize.y / 2.0;
	}
	else if (fv == VerticalPlace::en::bottom){
		dPos.y -= fontSize.y;
	}
	Vector2 shift(-(int)fh * fontSize.x * 0.5, -(int)fv * fontSize.y * 0.5);
	Vector2 leftTop(pos.x + dx + dPos.x, pos.y + dy + dPos.y);
	Draw.box(leftTop - boxMargeV2 * 0.5, leftTop + fontSize + boxMargeV2 * 0.5, boxColor, boxAlpha);
	SetDrawBlendMode(blendMode, alpha);
	DrawFormatStringToHandle(leftTop.x, leftTop.y, color, fontHandle, "%s", str.c_str());
	textDrawLog.set(leftTop, color, fontHandle, alpha, blendMode);
}
Exemplo n.º 25
0
void GraphicManager::DrawLayer() {
    if (GlobalValue::state==Transitioning) {
        switch (GlobalValue::FadeType) {
            case FadeCross:
                CrossFade(fade_frame_left,fade_frame);
                break;
            case FadeMove:
                MoveFade(fade_frame_left,fade_frame);
                break;
            case FadeCurtain:
                CurtainFade(fade_frame_left,fade_frame);
                break;
        }
        fade_frame_left--;

        if (this->fade_frame_left==0) {
            for (int i=0;i<GlobalValue::LayerMax;i++) {
                if ((layer[i].enable)&&(layer[i].handle!=layer_back[i].handle)) {
                    DeleteGraph(layer[i].handle);
                }
                layer[i]=layer_back[i];
                layer_back[i].enable=false;
            }
            GlobalValue::state=Nothing;
        }
    }else{
        for (int i=0;i<GlobalValue::LayerMax;i++) {
            if (layer[i].enable) {
                DrawGraph(layer[i].x,layer[i].y,layer[i].handle,TRUE);
            }
        }
    }
    SetDrawBlendMode(DX_BLENDMODE_NOBLEND,0);
}
Exemplo n.º 26
0
void Scene_Battle::DrawBG() const{
	// マップ画面の描画
	if(g_temp.hBGHandle != -1){
		DrawGraph(0, 0, g_temp.hBGHandle, 0);
	}
	// 枠
	float rate;
	if(SceneIsReserved()){
		rate = 1.00*(BATTLE_END_TIME-reservedCount)/BATTLE_END_TIME;
	}else{
		rate = 1.00*sceneTime/BATTLE_START_TIME;
	}
	rate = max(0.01, min(1.0, rate));

	int l, r, t, b;
	l = (WND_WIDTH-BATTLE_WINDOW_WIDTH)/2;
	t = BATTLE_WINDOW_CY-rate*BATTLE_WINDOW_HEIGHT/2;
	r = (WND_WIDTH+BATTLE_WINDOW_WIDTH)/2;
	b = BATTLE_WINDOW_CY+rate*BATTLE_WINDOW_HEIGHT/2;
	DrawBox(
		l-2, t-2, r+2, b+2,
		GetColor(255,255,255), 1);
	DrawBox(
		l, t, r, b,
		GetColor(0, 0, 0), 1);

	// DrawBox(0, 0, WND_WIDTH, WND_HEIGHT, 0x000000ff, 1);
	SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255);
	// 背景描画エリアの限定
	SetDrawArea(l, t, r, b);

	// エフェクト背景の描画
	bgEffect.Draw();

}
Exemplo n.º 27
0
void Stage::drawBrightenedPoints(){
	for(int d = 0; d < depth; ++d){
		for(int w = 0; w < width; ++w){
			if(mapchip[d][w].is_brighting){
				SetDrawBlendMode(DX_BLENDMODE_ALPHA, 192);
				drawChip(w, d, mapchip[d][w].bright_color);
				SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);
			}
			if(w == Cursor::pos.x && d == Cursor::pos.y){
				SetDrawBlendMode(DX_BLENDMODE_ALPHA, 192);
				drawChip(w, d, GetColor(255,0,0));
				SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);
			}
		}
	}
}
Exemplo n.º 28
0
//独自
//中心を指定して箱を描画
void DrawImpl::centerBox(const Vector2& center_pos, const Vector2& size, int color, int alpha, int blendMode){
	SetDrawBlendMode(blendMode, alpha);
	DrawBox(
		center_pos.x - size.x / 2 + dx, center_pos.y - size.y / 2 + dy,
		center_pos.x + size.x / 2 + dx, center_pos.y + size.y / 2 + dy,
		color, 1);
}
Exemplo n.º 29
0
void CObject_Bg_Stage1_2::Render()
{
	int _width = 0;
	int _height = 0;

	SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255);
	GetGraphSize(GraphHandle, &_width, &_height); 

	DrawRectGraph((int)fDrawX, (int)fDrawY, SrcX, SrcY, 1024, 768, GraphHandle, TRUE, FALSE);
	DrawRectGraph((int)fDrawX, (int)fDrawY, (SrcX-_width), SrcY+768, 1024, 768, GraphHandle, TRUE, FALSE);
	
	SetDrawBlendMode(DX_BLENDMODE_ALPHA, Hero->GetOpacity());
	DrawGraphF(1160 - SrcX, 180, GetResourceWithKey(IMAGE_STAGE1_2_FOREST), TRUE);
	
	SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255);
}
Exemplo n.º 30
0
Scene * ScenePause::Update()
{
	Bright::Instance()->ChangeBright(150);
	MapChip::Instance()->Draw(*stage->GetCamera());
	GameEntity::DrawAll();
	Bright::Instance()->ChangeBright(255);

	MoveCursorY(3);

	switch (curY) {
	case 0:
		if (input->Get(INPUT_Z) == 1) {
			Sound::Instance()->ChangeVolume(4.0);
			Sound::Instance()->Play("ポーズ");
			return new SceneGameMain(stage);
		}
		break;
	case 1:
		if (input->Get(INPUT_Z) == 1) {
			Sound::Instance()->ChangeVolume(4.0);
			Sound::Instance()->StopAll();
			Sound::Instance()->Play("決定");
			return new SceneTitle();
		}
		break;
	case 2:
		if (input->Get(INPUT_Z) == 1) {
			Sound::Instance()->Play("決定");
			return nullptr;
		}
		break;
	}

	if (input->Get(INPUT_P) == 1) {
		Sound::Instance()->ChangeVolume(4.0);
		Sound::Instance()->Play("ポーズ");
		return new SceneGameMain(stage);
	}

	const char* pause_menu[] = {
		{ "ゲームへ戻る" },
		{ "タイトルへ戻る" },
		{ "終了" },
	};

	DWORD col;
	int sx = 200, sy = 170, dist = 32;
	SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255);
	DrawGraph(sx, sy, images[0], TRUE);
	DrawGraph(WINDOW_WIDTH - 64, WINDOW_HEIGHT - 30, images[1], TRUE);
	DrawGraph(WINDOW_WIDTH - 64 + 24, WINDOW_HEIGHT - 30 - 16, images[2], TRUE);

	for (int i = 0; i < 3; ++i) {
		col = (curY == i) ? 0xffffff : 0xaaaaaa;
		fonts[1]->DrawFontString(sx + 40, sy + 28 + dist*i, col, pause_menu[i]);
	}

	return this;
}