зеркало из https://github.com/microsoft/DirectXTK.git
Updated Drawing text (markdown)
Родитель
33e85dac99
Коммит
c04039b804
|
@ -140,13 +140,13 @@ In **Game.cpp**, modify the TODO section of **Render** to be:
|
||||||
|
|
||||||
const wchar_t* output = L"Hello World";
|
const wchar_t* output = L"Hello World";
|
||||||
|
|
||||||
|
Vector2 origin = m_font->MeasureString(output) / 2.f;
|
||||||
|
|
||||||
m_font->DrawString(m_spriteBatch.get(), output,
|
m_font->DrawString(m_spriteBatch.get(), output,
|
||||||
m_fontPos + Vector2(1.f, 1.f), Colors::Black, 0.f, origin);
|
m_fontPos + Vector2(1.f, 1.f), Colors::Black, 0.f, origin);
|
||||||
m_font->DrawString(m_spriteBatch.get(), output,
|
m_font->DrawString(m_spriteBatch.get(), output,
|
||||||
m_fontPos + Vector2(-1.f, 1.f), Colors::Black, 0.f, origin);
|
m_fontPos + Vector2(-1.f, 1.f), Colors::Black, 0.f, origin);
|
||||||
|
|
||||||
Vector2 origin = m_font->MeasureString(output) / 2.f;
|
|
||||||
|
|
||||||
m_font->DrawString(m_spriteBatch.get(), output,
|
m_font->DrawString(m_spriteBatch.get(), output,
|
||||||
m_fontPos, Colors::White, 0.f, origin);
|
m_fontPos, Colors::White, 0.f, origin);
|
||||||
|
|
||||||
|
@ -164,6 +164,8 @@ In **Game.cpp**, modify the TODO section of **Render** to be:
|
||||||
|
|
||||||
const wchar_t* output = L"Hello World";
|
const wchar_t* output = L"Hello World";
|
||||||
|
|
||||||
|
Vector2 origin = m_font->MeasureString(output) / 2.f;
|
||||||
|
|
||||||
m_font->DrawString(m_spriteBatch.get(), output,
|
m_font->DrawString(m_spriteBatch.get(), output,
|
||||||
m_fontPos + Vector2(1.f, 1.f), Colors::Black, 0.f, origin);
|
m_fontPos + Vector2(1.f, 1.f), Colors::Black, 0.f, origin);
|
||||||
m_font->DrawString(m_spriteBatch.get(), output,
|
m_font->DrawString(m_spriteBatch.get(), output,
|
||||||
|
@ -173,8 +175,6 @@ In **Game.cpp**, modify the TODO section of **Render** to be:
|
||||||
m_font->DrawString(m_spriteBatch.get(), output,
|
m_font->DrawString(m_spriteBatch.get(), output,
|
||||||
m_fontPos + Vector2(1.f, -1.f), Colors::Black, 0.f, origin);
|
m_fontPos + Vector2(1.f, -1.f), Colors::Black, 0.f, origin);
|
||||||
|
|
||||||
Vector2 origin = m_font->MeasureString(output) / 2.f;
|
|
||||||
|
|
||||||
m_font->DrawString(m_spriteBatch.get(), output,
|
m_font->DrawString(m_spriteBatch.get(), output,
|
||||||
m_fontPos, Colors::White, 0.f, origin);
|
m_fontPos, Colors::White, 0.f, origin);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче