Commit 370a94b7 authored by Al's avatar Al

combat timers adapted succesfully

parent 16dbe88a
......@@ -134,7 +134,7 @@ void CombatManager::Draw(Graphics& gfx)
enMan.get()->DrawIntent(gfx);
}
timers.DrawTimer(gfx);
timers.DrawTimer();
turnAnnouncer.Draw(gfx,killcount);
}
......
......@@ -39,17 +39,17 @@ void CombatTimers::SkipTimer()
}
}
void CombatTimers::DrawTimer(Graphics & gfx)const
void CombatTimers::DrawTimer()const
{
{
//assert(curTimer == ActiveTimer::Countdown); //FOR NOW
if (curTimer == ActiveTimer::Countdown)
{
countTimer.DrawDigit(gfx);
countTimer.DrawDigit();
}
else if (curTimer == ActiveTimer::Turn)
{
turnTimer.Draw(gfx);
turnTimer.Draw();
}
}
}
......
#pragma once
#include "./Framework/Graphics.h"
#include "SoundPlayerInterface.h"
#include "TextDrawingUnit.h"
class CombatTimers
{
......@@ -9,7 +9,7 @@ public:
void SkipTimer();
void DrawTimer(Graphics& gfx) const;
void DrawTimer() const;
void SetActiveTimer(int t, float turnTime = 0); //0 - no,1 - count,2 - turn
......@@ -40,9 +40,9 @@ private:
}
void Draw(Graphics& gfx)const
void Draw()const
{
gfx.DrawString(std::to_string(remainingTime), Vec2(920, 500), Colors::Red, 5.0f);
TDU::DrawString(std::to_string(remainingTime), Vec2(0.5f,-0.1f), Colors::Red, 0.03f);
}
private:
......@@ -100,22 +100,22 @@ private:
remainingDigitTime = defaultGoTime;
curDigit = Digits::go;
}
void DrawDigit(Graphics& gfx)const
void DrawDigit()const
{
switch (curDigit)
{
case CombatTimers::CountdownTimer::three:
gfx.DrawString("3", Vec2(920, 500), Colors::Red,5.0f);
TDU::DrawString("3", Vec2(0, 0), Colors::Red,0.1f);
break;
case CombatTimers::CountdownTimer::two:
gfx.DrawString("2", Vec2(920, 500), Colors::Red, 5.0f);
TDU::DrawString("2", Vec2(0, 0), Colors::Red, 0.1f);
break;
case CombatTimers::CountdownTimer::one:
gfx.DrawString("1", Vec2(920, 500), Colors::Red, 5.0f);
TDU::DrawString("1", Vec2(0, 0), Colors::Red, 0.1f);
break;
case CombatTimers::CountdownTimer::go:
gfx.DrawString("GO", Vec2(920, 500), Colors::Red, 5.0f);
TDU::DrawString("GO", Vec2(0, 0), Colors::Red, 0.1f);
break;
default:
break;
......
......@@ -48,7 +48,7 @@ MainScene::MainScene(Graphics & gfx)
void MainScene::Update(Keyboard& kbd, Mouse& mouse, float dt)
{
TextDrawingUnit::DrawString("123\n456", Vec2(0, 0), Colors::Blue,0.01f);
TextDrawingUnit::DrawString("123\n456", Vec2(0, 0), Colors::Blue);
hud.Update(dt);
for (int i = 0; i < scenarios.size(); i++)
......
#include "TextDrawingUnit.h"
#include "Framework/Plane.h"
void TextDrawingUnit::DrawString(std::string outputText, Vec2 position, Color c, float scale)
void TextDrawingUnit::DrawString(std::string outputText, Vec2 position, Color c, float scale )
{
Vec2 curPos = position;
......
......@@ -2,6 +2,7 @@
#include "./Framework/Surface.h"
#include "./Framework/IndexedTriangleList.h"
#include "HUDEffectChromKeyed.h"
#define TDU TextDrawingUnit
class TextDrawingUnit
{
public:
......@@ -25,7 +26,7 @@ public:
textSpriteSheet = std::make_unique<Surface>(L"Media\\Sprites\\Fixedsys16x28.bmp");
}
static void DrawString(std::string outputText, Vec2 position, Color c, float scale = 1.0f);
static void DrawString(std::string outputText, Vec2 position, Color c, float scale = 0.01f);
static std::vector<Letter> GetTextForDrawing() //make a friend function
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment