// ------------------------------------------------------------------------------------------------
void PlayerCharacterView :: DrawHUD() {
    DrawScoreBoard();

	if(pc->TargetId() != INVALID_ID) {
		PlayerCharacter* target = game->GetCharacter(pc->TargetId());
		targetRingSceneNode->setPosition(target->Pos());
		targetRingSceneNode->setVisible(true);
			/*
			// Draw target health:
			DrawText(	target->Pos().x - camPos.x - surfaceTargetRing->w/2 - 10,
						target->Pos().y - camPos.y - surfaceTargetRing->h/2 - 20,
						ToString(target->Health()));
			*/
	}
	else {
		targetRingSceneNode->setVisible(false);
	}

		/*
		vector3df charScreenPos = myPc->Pos() - camPos;

		// Draw health:
		DrawText(charScreenPos.x - 10, charScreenPos.y - 20, ToString(myPc->Health()));
		*/
} // ----------------------------------------------------------------------------------------------
Пример #2
0
void LayerControl::Draw(SDL_Surface *screen)
{

    if (System::IsGameOver())
    {
        m_startButton.SetLabel("Start");
    }

    //
    // Draw Start/Stop Button.
    //

    m_startButton.Draw(m_startButtonSurface);
    ApplySurface(m_startButton.GetX(), m_startButton.GetY(), m_startButtonSurface, screen);

    //
    // Draw Pause button.
    //

    m_resetButton.Draw(m_resetButtonSurface);
    ApplySurface(m_resetButton.GetX(), m_resetButton.GetY(), m_resetButtonSurface, screen);

    //
    // Draw Exit button.
    //

    m_exitButton.Draw(m_exitButtonSurface);
    ApplySurface(m_exitButton.GetX(), m_exitButton.GetY(), m_exitButtonSurface, screen);

    //
    // Draw preview.
    //

    m_preview.Draw(m_previewSurface);
    ApplySurface(m_preview.GetX(), m_preview.GetY(), m_previewSurface, screen);

    //
    // Draw score.
    //

    DrawScoreBoard(screen);
}