Example #1
0
void CGUIButtonControl::ProcessText(unsigned int currentTime)
{
  CRect labelRenderRect = m_label.GetRenderRect();
  CRect label2RenderRect = m_label2.GetRenderRect();

  float renderWidth = GetWidth();
  bool changed = m_label.SetMaxRect(m_posX, m_posY, renderWidth, m_height);
  changed |= m_label.SetText(m_info.GetLabel(m_parentID));
  changed |= m_label.SetScrolling(HasFocus());
  changed |= m_label2.SetMaxRect(m_posX, m_posY, renderWidth, m_height);
  changed |= m_label2.SetText(m_info2.GetLabel(m_parentID));

  // text changed - images need resizing
  if (m_minWidth && (m_label.GetRenderRect() != labelRenderRect))
    SetInvalid();

  // auto-width - adjust hitrect
  if (m_minWidth && m_width != renderWidth)
  {
    CRect rect(m_posX, m_posY, renderWidth, m_height);
    SetHitRect(rect, m_hitColor);
  }

  // render the second label if it exists
  if (!m_info2.GetLabel(m_parentID).empty())
  {
    changed |= m_label2.SetAlign(XBFONT_RIGHT | (m_label.GetLabelInfo().align & XBFONT_CENTER_Y) | XBFONT_TRUNCATED);
    changed |= m_label2.SetScrolling(HasFocus());

    // If overlapping was corrected - compare render rects to determine
    // if they changed since last frame.
    if (CGUILabel::CheckAndCorrectOverlap(m_label, m_label2))
      changed |= (m_label.GetRenderRect()  != labelRenderRect ||
                  m_label2.GetRenderRect() != label2RenderRect);

    changed |= m_label2.SetColor(GetTextColor());
    changed |= m_label2.Process(currentTime);
  }
  changed |= m_label.SetColor(GetTextColor());
  changed |= m_label.Process(currentTime);
  if (changed)
    MarkDirtyRegion();
}
Example #2
0
//================================================
//ゲームメイン画面描画
//================================================
void DrawMain(void)
{
	frame.IsDisp = TRUE;
	
	/*当たり判定領域設定*/
	SetHitRect();
	
	g_Second++;
	
	if(!player.IsStop)
	{
		g_gamecounter++;
	}
	
	//------------------------------------------
	//アニメーション処理
	//------------------------------------------
	if(g_Second % 20 == 0)
	{
		player.animcounter++;

		if(!player.IsStop)
		{
			for(int i = 0;i < ENEMY_NUM;i++)
			{
				enemy[i].animcounter++;
			}
			
			boss.animcounter++;
		}
		
	}
	
	if(g_Second % 5 == 0)
	{
		if(!player.IsStop)
		{
			for(int i = 0;i < SKULL_NUM;i++)
			{
				boss.skull[i].animcounter++;
			}
			
			for(int i = 0;i < KNIFE_NUM;i++)
			{
				boss.knife[i].animcounter++;
			}
		}
		
	}

	/*ショット処理*/
	player.Shoot();
		
	/*当たり判定チェック*/
	CheckHitRect();
	
	//----------------------------------------
	//移動
	//----------------------------------------
	player.Move();
	
	/*敵の移動処理*/
	if(!player.IsStop)
	{
		EnemyMove();
		EnemyShoot();
	}
	
	/*ボスの移動処理*/
	if(!player.IsStop)
	{
		BossMove();
	}
	
	/*移動範囲補正*/
	MoveAdjust();
	
	player.UseGauge();
		
	//if(player.IsUseSpecial)
	//{
	//	if(LunaPad::GetState(0, PAD_STATE_PUSH, PAD_BUTTON_03) )
	//	{
	//		player.IsUseSpecial = FALSE;
	//	}
	//}
		
	//-----------------------------------------------------
	//化身状態
	//-----------------------------------------------------
	
	/*ポーズ*/
	if(LunaPad::GetState(0, PAD_STATE_PUSH, PAD_BUTTON_05) )
	{
		g_GameMode = SCENE_PAUSE;
	}
	
	/*カメラ更新*/
	if(!player.IsStop)
	{
		camera.Update();
	}
	
	model.Translation();
	
	/*キャラクタ変更*/
	player.UseCharaChange();
	
	/*待機ライフ回復*/
	if(Luna::GetSyncCounter() % 20 == 0)
	{
		player.Recoverlife();
	}
	
	/*ゲームオーバー処理*/
	if(player.IsDead)
	{
		g_GameMode = SCENE_GAMEOVER;
	}
	
	/*ボス死亡処理*/
	boss.Dead(&g_GameMode);
	
	player.Draw();
	
	//----------------------------------
	//シーン開始
	//----------------------------------
	if ( Luna3D::BeginScene() )
	{
		/*レンダリング*/
		Luna3D::SetRenderState(D3DRS_FOGENABLE, TRUE);
		
		model.Rendering();
		
		if(player.IsStop)
		{
			screen.IsDisp = TRUE;
			
			Luna3D::SetBlendingType(BLEND_REVERSE);
			screen.DrawTexture();
			Luna3D::SetBlendingType(BLEND_NORMAL);
		}
		
		Luna3D::SetRenderState(D3DRS_FOGENABLE, FALSE);
		
		Luna3D::SetFilterEnable(TRUE);
		
		/*敵出現ポイント*/
		EnemyPoint();
		
		frame.DrawTexture();
		
		player.Rendering();
		
		score.DrawFont(g_Score);
	
		boss.Rendering();
		
		// シーン終了
		Luna3D::EndScene();
	}
	
}